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

Diagram/refactor to class #19

Merged
merged 8 commits into from
Jan 11, 2022

Conversation

jayeclark
Copy link

OK, here's the final PR in the Diagram series for #8 . From now on it should be a lot easier to track work in progress.

Screen Shot 2022-01-11 at 10 59 27 AM

This series of commits creates a functioning Diagram class based on the original code. The constructor takes two arguments - sets, and config. Currently the constructor works exactly the same as in the old version (finds #diagramFrame and appends the SVG to it) but now it's in a state where the dom-based manipulation/d3 can gradually be removed. After that it would make sense to separate the loadDiagram method into two methods - create (creates an SVGElement based on the sets and config, and sets it as the value of this.element and render (takes one argument - the ID of the target element, finds that element, and appends this.element to it.)

I made a test page (a pared down version of index.html) where the diagram is being rendered by calling new Diagram (lines 1359 - 1375 of javascript.js).

Since another contributor was interested in converting to Typescript, and Diagram/SetService would be the obvious place to start, I'm happy to have him run with it for a bit!

I'm not sure why the extra commits are showing up (Ive been struggling a lot with git today) but hopefully I can figure out how to resolve it. The new work on this PR vs prior ones that were merged starts at commit 18d6083.

Signed-off-by: Jay Clark <jay@jayeclark.dev>
Signed-off-by: Jay Clark <jay@jayeclark.dev>
Signed-off-by: Jay Clark <jay@jayeclark.dev>
Signed-off-by: Jay Clark <jay@jayeclark.dev>
Signed-off-by: Jay Clark <jay@jayeclark.dev>
Signed-off-by: Jay Clark <jay@jayeclark.dev>
Signed-off-by: Jay Clark <jay@jayeclark.dev>
@heberleh heberleh merged commit 35c1756 into heberleh:dev Jan 11, 2022
@heberleh heberleh mentioned this pull request Jan 11, 2022
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

Successfully merging this pull request may close these issues.

2 participants