-
Notifications
You must be signed in to change notification settings - Fork 199
feat: restore remaining non-"Editor" examples to Storybook #150
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
Conversation
…sses instantiated by main Graph class such as the graph model and vertex/edge handlers
… method in MaxPopupMenu
|
@mcyph I don't understand the need to introduce There are already ways to override the
This is the historical mxGraph way. We can change it but this needs more discussions IMHO.
There are pros and cons for all solutions. Does it make sense? |
|
@tbouffard Have started a new discussion at #151 and moved my comments there, let me know your thoughts |
|
As I mention there, if wanting to keep with the conventions previously established by mxGraph I'm inclined to go with the Bear in mind the "draft" status of this merge request - I'm heading overseas for a few weeks+knew I likely won't have time to work on it while away, but have tried to fix as many examples as I could in last few weeks. I would've liked to have fixed the editor examples too, but I thought that would take longer. If anyone would like to make changes to this or the other "Touches" branch in the meantime feel free. |
|
Thanks @mcyph for the quick feedback and the status. Don't worry, maxGraph already owes you a lot, so we can all wait a bit for the finalization of this contribution. 👍🏿 I saw the Draft status, that's exactly why I wanted to let you know eventual issues with the newly introduced GraphInstantiators prior you move forward. 😄 I will feed the new discussion with my ideas. |
…ators to the Graph constructor; fixes to the "Wires" story
|
About "Codec (does not appear to load elements; needs to be investigated)": |
# Conflicts: # packages/core/src/view/Graph.ts
Use single line comments instead of JSDoc styled-comments that could mess IDE and documentation generation
|
I am in the process of reviving this PR. |
Fix imports Adjust the code when needed Apply prettier Fix file header GraphLayout HtmlLabel MenuStyle ShowRegion Scrollbars Wires
|
I have made the following stories work with Storybook v7. They are still written in JavaScript (I didn't have time to port them to TypeScript):
The examples are still not fully working. As the mxGraph examples were previously migrated to nextjs/react, some original code may not have been ported correctly. |
It was used a long time ago when examples were written in an application developed with Next.js
Summary
Converted the following remaining "stashed" examples to StoryBook:
Mostly have finished converting, but issues still remain:
<g>elements are inserted outside of the<svg>element)This is in addition to the PR at #149 which converted the "Pinch Zoom" example. Editor examples still remain unconverted, although some progress has been made converting the "Ports" example to StoryBook.
Also has some fixes for the default parameters for
MaxPopupMenuto restore the original mxGraph behavior.Description for the changelog
Converted remaining "stashed" non-Editor and touch-related examples to StoryBook.
Other info
[UPDATE] The following has been reverted, see #150 (comment), #151 and 43ab435.
This adds an additional parameter to the main
Graphclass to allow overriding the class constructors in the "instantiators" parameter. I think there may be a better term for this, and there is a good question whether this should be merged into the "plugins", or references to these class constructors set in the class variables and overridden in subclasses.As in types.ts, the following are able to be overridden:
Still unresolved is how to allow "local" changes to style (color, size etc) variables in
Constants.tsthat are referred. I think it may make sense to allow providing these as an argument toGraph, or have some way of assigning these locally.