Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Region Annotation #208

Open
TomYeoman opened this issue Aug 18, 2022 · 4 comments
Open

Region Annotation #208

TomYeoman opened this issue Aug 18, 2022 · 4 comments

Comments

@TomYeoman
Copy link

Hi @newcat!

We're looking at implementing region annotation within our project, and wondered whether there's any future plans for it (I know a V2 is in the works).

At a high level, the MVP looks something like -

  • Add button to create a "annotated region"
  • When clicked, allow a free draw rectangle
  • Once rectangle is drawn, it will start in "edit mode", whereby you will be able to set a title, description, set border colour, resize and save. In the future you will only be able to interact with it again via clicking the edit button in the corner of the region.
@newcat
Copy link
Owner

newcat commented Aug 22, 2022

Unfortunately I have very little time at the moment (that's also why it took me so long to answer, sorry for that). While this is an interesting feature, I honestly want to focus on finally releasing v2. I'll leave that issue open for now; either for someone else to implement it or for me to revisit after I have v2 kinda stable.

BTW: In v2 you can do something similar, although visually different: https://v2.baklava.tech/editor/subgraphs.html

@TomYeoman
Copy link
Author

No problem at all, I appreciate the response, and thanks for the information on the V2 work.

Subgraphs look useful, but not quite what we're after right now in terms of a lightweight way to quickly annotate graphs. I will keep this issue updated with how we progress!

@TomYeoman
Copy link
Author

TomYeoman commented Aug 31, 2022

Trying to get my head around this work, and I was wondering how this sounds.

Some sort of custom NodeAnnotator component needs to be created.

It seems the "baklava" way to do this, would be to create a new custom package @mypackage/node-annotator, however it doesn't seem like the event system really fulfils the requirements for this new component;

  • We need to access to the the internal state date within @baklavajs/plugin-renderer-vue (the scale property),
  • We must be able to render our annotation (I.E custom component) within the graph (I.E node-container) in order for scaling to work correctly. This is where things get a little more interesting. It looks like there is a way to add new components to @baklavajs/vue, however it must be to overwrite an existing core component type (https://newcat.github.io/baklavajs/#/styling?id=hardcore-customization).

This makes me feel like instead, an extension of @baklavajs/plugin-renderer-vue might be necessary (with this new custom component living in there) if we want to do this nicely, leaning on the framework.

Any input would be much appreciated.

newcat added a commit that referenced this issue Sep 14, 2022
@newcat
Copy link
Owner

newcat commented Oct 7, 2022

I have added a default <slot> to the editor so you can add custom content in there. I just noticed after releasing that you probably need a slot inside the .node-container div 🤦‍♂️ I'll add more slots in the next version but for now it should still be possible to add stuff to the editor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants