-
Notifications
You must be signed in to change notification settings - Fork 199
docs: add content to getting started page #598
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
docs: add content to getting started page #598
Conversation
WalkthroughThe pull request introduces significant updates to the documentation for the Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (6)
packages/website/docs/manual/getting-started.md (6)
Line range hint
1-4: Enhance the description to be more specificConsider expanding the description to better reflect the content, for example:
"A comprehensive guide to installing, configuring, and creating your first graph with maxGraph."🧰 Tools
🪛 LanguageTool
[style] ~64-~64: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...want to use TypeScript, adapt it if you want to use JavaScript (mainly, remove referenc...(REP_WANT_TO_VB)
[uncategorized] ~112-~112: You might be missing the article “a” here.
Context: ... into your application, you should have minimal graph displayed with a rectangle connec...(AI_EN_LECTOR_MISSING_DETERMINER_A)
[duplication] ~121-~121: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~127-~127: Possible typo: you repeated a word
Context: ...ents in an architectural diagram. #### Edges Edges are the connections in your graph that ...(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~134-~134: Possible typo: you repeated a word
Context: ...tionships in organization charts. #### Groups Groups in maxGraph allow you to logically orga...(ENGLISH_WORD_REPEAT_RULE)
🪛 Markdownlint (0.35.0)
114-114: null
Images should have alternate text (alt text)(MD045, no-alt-text)
208-208: null
Images should have alternate text (alt text)(MD045, no-alt-text)
37-52: Enhance installation instructions with additional detailsConsider adding:
- Version specification guidance (e.g.,
@maxgraph/core@latestvs specific versions)- Any peer dependencies that need to be installed
- A verification step to confirm successful installation
67-111: Improve TypeScript code example with better practicesConsider these improvements to the code example:
- Use more idiomatic TypeScript for type assertion:
-const container = <HTMLElement>document.getElementById('graph-container'); +const container = document.getElementById('graph-container') as HTMLElement;
- Add null check for container:
-const container = <HTMLElement>document.getElementById('graph-container'); +const container = document.getElementById('graph-container'); +if (!container) { + throw new Error('Container element not found'); +}
121-125: Improve Key Concepts section formatting and content
- Fix repeated headers by using different heading levels:
-#### Vertices -Vertices are... +#### Vertices +These are...
Consider adding simple code examples for each concept to demonstrate their usage.
Add a table or list comparing the key properties and methods available for each concept.
Also applies to: 127-132, 134-149
🧰 Tools
🪛 LanguageTool
[duplication] ~121-~121: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...(ENGLISH_WORD_REPEAT_RULE)
176-190: Enhance event handling example with more comprehensive coverageConsider expanding the event handling example to include:
- More common event types (e.g., double-click, right-click)
- Type safety for event properties
- Error handling
Example:
// Add type safety for event properties type ClickEventProperties = { cell: Cell | null; event: MouseEvent; }; graph.addListener(InternalEvent.CLICK, (sender, evt) => { try { const cell = evt.getProperty<Cell>('cell'); const mouseEvent = evt.getProperty<MouseEvent>('event'); if (cell) { // Handle cell click console.log('Clicked cell:', cell); console.log('Mouse coordinates:', mouseEvent.clientX, mouseEvent.clientY); } } catch (error) { console.error('Error handling click event:', error); } });
211-213: Expand the Help section with additional resourcesConsider adding:
- Link to Stack Overflow tags
- Community chat/forum links (if available)
- Links to related documentation sections
- Common troubleshooting scenarios
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (2)
packages/website/docs/manual/assets/getting-started/first-graph.gifis excluded by!**/*.gifpackages/website/docs/manual/assets/getting-started/vertex-style.pngis excluded by!**/*.png
📒 Files selected for processing (1)
packages/website/docs/manual/getting-started.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
packages/website/docs/manual/getting-started.md
[style] ~64-~64: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...want to use TypeScript, adapt it if you want to use JavaScript (mainly, remove referenc...
(REP_WANT_TO_VB)
[uncategorized] ~112-~112: You might be missing the article “a” here.
Context: ... into your application, you should have minimal graph displayed with a rectangle connec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[duplication] ~121-~121: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~127-~127: Possible typo: you repeated a word
Context: ...ents in an architectural diagram. #### Edges Edges are the connections in your graph that ...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~134-~134: Possible typo: you repeated a word
Context: ...tionships in organization charts. #### Groups Groups in maxGraph allow you to logically orga...
(ENGLISH_WORD_REPEAT_RULE)
🪛 Markdownlint (0.35.0)
packages/website/docs/manual/getting-started.md
114-114: null
Images should have alternate text (alt text)
(MD045, no-alt-text)
208-208: null
Images should have alternate text (alt text)
(MD045, no-alt-text)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (6)
packages/website/docs/manual/getting-started.md (6)
Line range hint
1-36: LGTM! Consider adding version compatibility information.The header section is well-structured with clear licensing, proper attribution, and helpful warning about the WIP status. Consider adding information about which versions of maxGraph this documentation applies to.
🧰 Tools
🪛 LanguageTool
[style] ~64-~64: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...want to use TypeScript, adapt it if you want to use JavaScript (mainly, remove referenc...(REP_WANT_TO_VB)
[uncategorized] ~112-~112: Possible missing article found.
Context: ... into your application, you should have minimal graph displayed with a rectangle connec...(AI_HYDRA_LEO_MISSING_A)
[duplication] ~121-~121: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~127-~127: Possible typo: you repeated a word
Context: ...ents in an architectural diagram. #### Edges Edges are the connections in your graph that ...(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~134-~134: Possible typo: you repeated a word
Context: ...tionships in organization charts. #### Groups Groups in maxGraph allow you to logically orga...(ENGLISH_WORD_REPEAT_RULE)
37-53: Consider enhancing installation instructions.While the basic installation commands are clear, consider adding:
- Example package.json configuration
- List of peer dependencies (if any)
- Common troubleshooting steps
- Minimum required Node.js version
81-111: Consider adding error handling and type safety to the graph creation example.The example could benefit from:
- Type annotations for the vertex and edge objects
- Error handling for failed insertions
- Comments explaining the style properties
121-121: Fix repeated headings in the key concepts section.Remove the duplicate headings for better readability:
-#### Vertices Vertices +#### Vertices -#### Edges Edges +#### Edges -#### Groups Groups +#### GroupsAlso applies to: 127-127, 134-134
🧰 Tools
🪛 LanguageTool
[duplication] ~121-~121: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...(ENGLISH_WORD_REPEAT_RULE)
179-189: Enhance event handling examples with type safety and error handling.Consider adding:
- TypeScript interfaces for event properties
- Error handling in callbacks
- Examples of other common events
+interface CellEvent extends Event { + getProperty(key: string): any; +} graph.addListener(InternalEvent.CLICK, (sender, evt) => { - const cell = evt.getProperty('cell'); + try { + const cell = (evt as CellEvent).getProperty('cell'); if (cell) { console.log('Clicked cell:', cell); } + } catch (error) { + console.error('Error handling cell click:', error); + } });
192-212: Expand the styling section with more examples.Consider adding:
- Examples of edge styling
- Custom style definitions
- Common style properties and their effects
- Style inheritance and overrides
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/website/docs/manual/getting-started.md(1 hunks)
🧰 Additional context used
🪛 LanguageTool
packages/website/docs/manual/getting-started.md
[style] ~64-~64: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...want to use TypeScript, adapt it if you want to use JavaScript (mainly, remove referenc...
(REP_WANT_TO_VB)
[uncategorized] ~112-~112: Possible missing article found.
Context: ... into your application, you should have minimal graph displayed with a rectangle connec...
(AI_HYDRA_LEO_MISSING_A)
[duplication] ~121-~121: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~127-~127: Possible typo: you repeated a word
Context: ...ents in an architectural diagram. #### Edges Edges are the connections in your graph that ...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~134-~134: Possible typo: you repeated a word
Context: ...tionships in organization charts. #### Groups Groups in maxGraph allow you to logically orga...
(ENGLISH_WORD_REPEAT_RULE)
tbouffard
left a comment
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.
Thanks for this PR, this looks great.
I will try to have a look at it this week (I have currently limited time to work on maxGraph).
In the meantime, I will answer to your question about the documentation roadmap in #595. IMHO, it is important we agree on a plan for the documentation. For example, what we put in the README (to limit the duplication with the documentation to reduce maintenance needs), what we keep from the former mxGraph documenation.
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.
Actionable comments posted: 0
🧹 Nitpick comments (5)
packages/website/docs/manual/getting-started.mdx (5)
1-4: Consider adding version compatibility informationSince this is a getting started guide, it would be helpful to specify the minimum supported versions of Node.js and TypeScript required to use maxGraph.
--- sidebar_position: 2 description: Getting started with maxGraph. +requirements: + - Node.js >= 14.0.0 + - TypeScript >= 3.8.0 ---
41-61: Consider adding peer dependencies informationIf maxGraph has any peer dependencies, it would be helpful to list them in the installation section.
138-144: Improve section headers to avoid word repetitionConsider revising the section headers to avoid word repetition:
-#### Vertices -Vertices are the fundamental elements... +#### Vertex Elements +Vertices are the fundamental elements... -#### Edges -Edges are the connections... +#### Edge Connections +Edges are the connections... -#### Groups -Groups in `maxGraph`... +#### Grouping Elements +Groups in `maxGraph`...Also applies to: 152-152
🧰 Tools
🪛 LanguageTool
[duplication] ~138-~138: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~144-~144: Possible typo: you repeated a word
Context: ...ents in an architectural diagram. #### Edges Edges are the connections in your graph that ...(ENGLISH_WORD_REPEAT_RULE)
196-210: Enhance event handling examplesConsider adding more practical event handling examples such as:
- Double-click events for editing
- Context menu events
- Drag and drop events
214-227: Expand styling examplesConsider adding more comprehensive styling examples including:
- Edge styling
- Custom shapes
- Gradient fills
- Custom markers
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
README.md(4 hunks)packages/website/docs/intro.md(2 hunks)packages/website/docs/manual/getting-started.mdx(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- packages/website/docs/intro.md
🧰 Additional context used
🪛 LanguageTool
packages/website/docs/manual/getting-started.mdx
[style] ~79-~79: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...want to use TypeScript, adapt it if you want to use JavaScript (mainly, remove referenc...
(REP_WANT_TO_VB)
[duplication] ~138-~138: Possible typo: you repeated a word
Context: ...nts: vertices, edges, and groups. #### Vertices Vertices are the fundamental elements of your gr...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~144-~144: Possible typo: you repeated a word
Context: ...ents in an architectural diagram. #### Edges Edges are the connections in your graph that ...
(ENGLISH_WORD_REPEAT_RULE)
[duplication] ~152-~152: Possible typo: you repeated a word
Context: ...tionships in organization charts. #### Groups Groups in maxGraph allow you to logically or...
(ENGLISH_WORD_REPEAT_RULE)
🔇 Additional comments (3)
packages/website/docs/manual/getting-started.mdx (2)
228-228: Verify the image asset exists
Please ensure that the image file ./assets/getting-started/vertex-style.png exists in the correct location and is committed to the repository.
✅ Verification successful
Image asset exists at the specified location
The image file vertex-style.png is present in the correct location at packages/website/docs/manual/assets/getting-started/vertex-style.png.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the image file exists
fd -t f "vertex-style.png" packages/website/docs/manual/assets/getting-started/
Length of output: 148
129-129: Verify the image asset exists
Please ensure that the image file ./assets/getting-started/first-graph.gif exists in the correct location and is committed to the repository.
✅ Verification successful
Image asset exists at the specified location
The referenced image file first-graph.gif exists at the correct path: packages/website/docs/manual/assets/getting-started/first-graph.gif
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the image file exists
fd -t f "first-graph.gif" packages/website/docs/manual/assets/getting-started/
Length of output: 146
README.md (1)
Line range hint 43-183: LGTM! Documentation sections are well-organized
The addition of comment markers clearly indicates which sections are shared across different documentation files, making maintenance easier.
tbouffard
left a comment
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.
LGTM, thanks for this contribution @HalilFocic
I took the liberty of making a few changes directly in the branch of this PR:
- use the same gif in the README and documentation
- mark the parts of the README that are duplicated in the documentation for easier maintenance
- use tabs in the installation paragraph to shorten content
- a few styling adjustments
The content of this getting started section can be repeated later, once the mxGraph tutorial has been integrated into the documentation.
I'm going to leave this PR open for a few days to allow you to give feedback if the changes I've applied cause any problems.
Thanks. I will check it tomorrow first thing in the morning. We can chat more about docs parts in the dicsussion I started. I am willing to translate the existing mxGraph to maxGraph docs but I think we should structure it differently so it's easier for newcommers to adopt max graph. |
I'm thinking exactly the same thing and I also wanted to share some thoughts on the subject and how we might move forward on this theme. |
LGTM. Sorry, got super busy since it's end of the year. We can maybe try make some roadmap and tasks in the January. I can take the toll of writing the docs but I would like for us to sync and be on the same page about which direction are we going. If there is any non docs related bugs/features I could take a lot until end of the year, please feel free to link them in reply or assign me to them. |
tbouffard
left a comment
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.
LGTM
PR Checklist
maxGraph, and you are assigned to the issue.packages/core/_tests_or a new or altered Storybook story inpackages/html/stories(an existing story may also demonstrate the change).or no docs changes are needed.Overview
Since we didn't have any getting started page on our docs, I took some time to add basic getting started guide which includes the following:
Notes
This probably is not the final version of the Getting started docs but it is sure a better version than what we have now.
Summary by CodeRabbit
New Features
Bug Fixes
maxGraphpackage.