-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
standardize info diagram definitions #4486
standardize info diagram definitions #4486
Conversation
there is no need for matching, capturing results, and validating nullablity just using `.test` would be enough and significantly faster for more info, see https://stackoverflow.com/10940138/16476610
* create types * remove unnessery db attributes * convert js files to ts * remove empty styles.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent work, long overdue!
Keep going 🚀
Thanks! Well do! If you could give some feedback on |
For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to assign Document
d3 type to the new HTML
one, there are some differences, so I can't make it a union type, it will affect the regular select('body')
.
If you've got a better design for this mess, let me know so I can follow it with other renders.
4f380fa
to
7e639be
Compare
@sidharthv96 please re-review latest changes so I can uses the new types in pie chart files. |
Should we mock I know it has no use but just to standardize definitions. And I'm currently working on pie chart files, should try supporting |
You can add it if it's required to run any tests. No need to add and maintain files just for standardizing.
You can actually remove all the
It's better not to mix things. I actually had that habit a while back (still do for small things 😅), but it's best to keep things separate. |
Ok.
It would affect many files and be hard to review. I'll remove them when converting the test file of the diagram.
It will be the same thing at the end; when trying to add styles, it will affect and change many files, and then it would be better to make each PR a separate diagram. But ok, I'll leave it to separate PR. So is the pr ready to merged? |
@Yokozuna59, Thank you for the contribution! |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [mermaid](https://togithub.com/mermaid-js/mermaid) | [`10.2.3` -> `10.2.4`](https://renovatebot.com/diffs/npm/mermaid/10.2.3/10.2.4) | [![age](https://badges.renovateapi.com/packages/npm/mermaid/10.2.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/mermaid/10.2.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/mermaid/10.2.4/compatibility-slim/10.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/mermaid/10.2.4/confidence-slim/10.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>mermaid-js/mermaid (mermaid)</summary> ### [`v10.2.4`](https://togithub.com/mermaid-js/mermaid/releases/tag/v10.2.4): 10.2.4 [Compare Source](https://togithub.com/mermaid-js/mermaid/compare/v10.2.3...v10.2.4) #### Features - Add Plausible analytics to mermaid.js.org by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4473](https://togithub.com/mermaid-js/mermaid/pull/4473) - Support for development in Docker by [@​nirname](https://togithub.com/nirname) in [https://github.com/mermaid-js/mermaid/pull/4478](https://togithub.com/mermaid-js/mermaid/pull/4478) - standardize info diagram definitions by [@​Yokozuna59](https://togithub.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4486](https://togithub.com/mermaid-js/mermaid/pull/4486) - Change C4 stereotype braces from ASCII <\</>> to Unicode «/» by [@​jonathan-r-young](https://togithub.com/jonathan-r-young) in [https://github.com/mermaid-js/mermaid/pull/4460](https://togithub.com/mermaid-js/mermaid/pull/4460) - Add coverage for E2E tests by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4498](https://togithub.com/mermaid-js/mermaid/pull/4498) - set normal mode for vitest coverage by [@​Yokozuna59](https://togithub.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4505](https://togithub.com/mermaid-js/mermaid/pull/4505) - Use v8 coverage in vitest by [@​sidharthv96](https://togithub.com/sidharthv96) in [https://github.com/mermaid-js/mermaid/pull/4560](https://togithub.com/mermaid-js/mermaid/pull/4560) - feat(flowchart): add classDef style group definition by [@​tomperr](https://togithub.com/tomperr) in [https://github.com/mermaid-js/mermaid/pull/3923](https://togithub.com/mermaid-js/mermaid/pull/3923) - add cypress coverage clean by [@​Yokozuna59](https://togithub.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4556](https://togithub.com/mermaid-js/mermaid/pull/4556) - fix(class): keep members in namespace classes by [@​tomperr](https://togithub.com/tomperr) in [https://github.com/mermaid-js/mermaid/pull/4532](https://togithub.com/mermaid-js/mermaid/pull/4532) #### Bugfixes - Add hint on "flowchart" and "graph" by [@​koppor](https://togithub.com/koppor) in [https://github.com/mermaid-js/mermaid/pull/4096](https://togithub.com/mermaid-js/mermaid/pull/4096) - fix(flowchart): apply style on doublecircle by [@​tomperr](https://togithub.com/tomperr) in [https://github.com/mermaid-js/mermaid/pull/4540](https://togithub.com/mermaid-js/mermaid/pull/4540) - fix not rendered style when style is optional by [@​Yokozuna59](https://togithub.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4528](https://togithub.com/mermaid-js/mermaid/pull/4528) - fix(flowchart): allow multiple vertices with style by [@​tomperr](https://togithub.com/tomperr) in [https://github.com/mermaid-js/mermaid/pull/4553](https://togithub.com/mermaid-js/mermaid/pull/4553) #### Documentation - change REAMDME.md coverage from coveralls into codecov by [@​Yokozuna59](https://togithub.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4507](https://togithub.com/mermaid-js/mermaid/pull/4507) - Update latest news section by [@​huynhicode](https://togithub.com/huynhicode) in [https://github.com/mermaid-js/mermaid/pull/4468](https://togithub.com/mermaid-js/mermaid/pull/4468) - Fix link to Tutorials from n00b-overview page by [@​Spiderpig86](https://togithub.com/Spiderpig86) in [https://github.com/mermaid-js/mermaid/pull/4472](https://togithub.com/mermaid-js/mermaid/pull/4472) - Fix Directives Documentation by [@​adamazing](https://togithub.com/adamazing) in [https://github.com/mermaid-js/mermaid/pull/4475](https://togithub.com/mermaid-js/mermaid/pull/4475) - Correct "Bronze" spelling in timeline docs by [@​adamazing](https://togithub.com/adamazing) in [https://github.com/mermaid-js/mermaid/pull/4467](https://togithub.com/mermaid-js/mermaid/pull/4467) - Document recommended file extension and MIME type docs by [@​bollwyvl](https://togithub.com/bollwyvl) in [https://github.com/mermaid-js/mermaid/pull/4485](https://togithub.com/mermaid-js/mermaid/pull/4485) - Fix typo in quadrant chart documentation by [@​tobie](https://togithub.com/tobie) in [https://github.com/mermaid-js/mermaid/pull/4512](https://togithub.com/mermaid-js/mermaid/pull/4512) - fix cspell issues in \*.md files by [@​Yokozuna59](https://togithub.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4531](https://togithub.com/mermaid-js/mermaid/pull/4531) - docs: Howto on foreground color on timelines by [@​mcbeelen](https://togithub.com/mcbeelen) in [https://github.com/mermaid-js/mermaid/pull/4524](https://togithub.com/mermaid-js/mermaid/pull/4524) - Add citation.cff file by [@​schackartk](https://togithub.com/schackartk) in [https://github.com/mermaid-js/mermaid/pull/4521](https://togithub.com/mermaid-js/mermaid/pull/4521) - Update Tutorials.md by [@​ellenealds](https://togithub.com/ellenealds) in [https://github.com/mermaid-js/mermaid/pull/4539](https://togithub.com/mermaid-js/mermaid/pull/4539) - Add Standard Notes extension in integrations page by [@​nienow](https://togithub.com/nienow) in [https://github.com/mermaid-js/mermaid/pull/4557](https://togithub.com/mermaid-js/mermaid/pull/4557) - Fix up Gantt Chart demo by [@​AlexMooney](https://togithub.com/AlexMooney) in [https://github.com/mermaid-js/mermaid/pull/4561](https://togithub.com/mermaid-js/mermaid/pull/4561) #### Chore - Update all patch dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4482](https://togithub.com/mermaid-js/mermaid/pull/4482) - chore: revise Contributing documentation by [@​weedySeaDragon](https://togithub.com/weedySeaDragon) in [https://github.com/mermaid-js/mermaid/pull/3814](https://togithub.com/mermaid-js/mermaid/pull/3814) - chore(deps): update all minor dependencies (minor) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4435](https://togithub.com/mermaid-js/mermaid/pull/4435) - fix(deps): update all patch dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4510](https://togithub.com/mermaid-js/mermaid/pull/4510) - fix(deps): update all patch dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4535](https://togithub.com/mermaid-js/mermaid/pull/4535) - chore(deps): update dependency eslint-plugin-jsdoc to v46 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4544](https://togithub.com/mermaid-js/mermaid/pull/4544) - chore(deps): update dependency jsdom to v22 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4546](https://togithub.com/mermaid-js/mermaid/pull/4546) - chore(deps): update dependency eslint-plugin-unicorn to v47 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4545](https://togithub.com/mermaid-js/mermaid/pull/4545) - chore(deps): update dependency workbox-window to v7 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4547](https://togithub.com/mermaid-js/mermaid/pull/4547) - chore(deps): update node.js to v20 by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4548](https://togithub.com/mermaid-js/mermaid/pull/4548) - fix(deps): update all patch dependencies (patch) by [@​renovate](https://togithub.com/renovate) in [https://github.com/mermaid-js/mermaid/pull/4543](https://togithub.com/mermaid-js/mermaid/pull/4543) - add `Suggested Solutions` field in `bug_report.yml` by [@​Yokozuna59](https://togithub.com/Yokozuna59) in [https://github.com/mermaid-js/mermaid/pull/4541](https://togithub.com/mermaid-js/mermaid/pull/4541) #### New Contributors - [@​Spiderpig86](https://togithub.com/Spiderpig86) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4472](https://togithub.com/mermaid-js/mermaid/pull/4472) - [@​adamazing](https://togithub.com/adamazing) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4475](https://togithub.com/mermaid-js/mermaid/pull/4475) - [@​koppor](https://togithub.com/koppor) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4096](https://togithub.com/mermaid-js/mermaid/pull/4096) - [@​nirname](https://togithub.com/nirname) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4478](https://togithub.com/mermaid-js/mermaid/pull/4478) - [@​Yokozuna59](https://togithub.com/Yokozuna59) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4486](https://togithub.com/mermaid-js/mermaid/pull/4486) - [@​jonathan-r-young](https://togithub.com/jonathan-r-young) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4460](https://togithub.com/mermaid-js/mermaid/pull/4460) - [@​tobie](https://togithub.com/tobie) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4512](https://togithub.com/mermaid-js/mermaid/pull/4512) - [@​schackartk](https://togithub.com/schackartk) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4521](https://togithub.com/mermaid-js/mermaid/pull/4521) - [@​mcbeelen](https://togithub.com/mcbeelen) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4524](https://togithub.com/mermaid-js/mermaid/pull/4524) - [@​ellenealds](https://togithub.com/ellenealds) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4539](https://togithub.com/mermaid-js/mermaid/pull/4539) - [@​nienow](https://togithub.com/nienow) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4557](https://togithub.com/mermaid-js/mermaid/pull/4557) - [@​AlexMooney](https://togithub.com/AlexMooney) made their first contribution in [https://github.com/mermaid-js/mermaid/pull/4561](https://togithub.com/mermaid-js/mermaid/pull/4561) **Full Changelog**: mermaid-js/mermaid@v10.2.3...v10.2.4 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/levaintech/contented). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xNDQuMiIsInVwZGF0ZWRJblZlciI6IjM1LjE0NC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
📑 Summary
Currently, most diagrams aren't fully typed, which causes some expected behaviors.
Originally, I was planning to do that here in #4450 while migrating to the new parser, but it appears it's going to take some time since I'm not familiar with the repo structure and the current DBs and still can't figure out a way to run the parser without the language server. I guess by adding and documenting the types and functions, I would be knowledgeable about the mermaid structure and each diagram style, definition, and DB, and then I would be able to use those DBs in the new parser.
Standardize diagrams definitions by:
Converting JS code into TS.
Remove
@ts-*
commentsAdd and use defined types and interfaces.
Add more JSDoc comments.
Standardize Diagrams Definition:
📏 Design Decisions
Describe the way your implementation works or what design decisions you made if applicable.
Diagram Definition:
svgDraw.js
if exists.Renderer
likequadrant
chart or converting it to TS likeflowchart
.📋 Tasks
Make sure you
develop
branch