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

Add penwidth attribute #39

Merged
merged 4 commits into from
Sep 20, 2018
Merged

Conversation

geminoa
Copy link
Collaborator

@geminoa geminoa commented Sep 18, 2018

This series of patches is for adding 'penwidth' attribute for dot parser which defines the line width as described in [1]. It includes refactoring of parseAttributeList() for reducing the number of lines to avoid max-statements limitation of lint.

[1] https://www.graphviz.org/doc/info/attrs.html#d:penwidth

To reduce the number of statements of parseAttributeList(), move parsing
'dir' attribute to function parseDirAttribute() because it is going to
reach max-statements limitation of lint.
'penwidth' defines the line width as 'width'. If both are exist,
'penwidth' is used and 'width' is discarded as described in [1].
This update fixes visjs-community#24.

[1] https://www.graphviz.org/doc/info/attrs.html#d:penwidth
Add an example penwidth attribute for dot language support.
@geminoa
Copy link
Collaborator Author

geminoa commented Sep 18, 2018

@micahstubbs
Copy link
Member

micahstubbs commented Sep 19, 2018

will take a look at this 😄

thanks for including an example!

@micahstubbs
Copy link
Member

micahstubbs commented Sep 19, 2018

@geminoa curious, could you run these commands and then commit the result? This should format the new code, which should in turn make Travis green.

yarn install
yarn format

Once Travis is green, this PR is ready to go in. Nice work @geminoa

@micahstubbs
Copy link
Member

I got the example running locally and it looks good to me.

http://127.0.0.1:8080/examples/data/dotLanguage/dotEdgeStyles/

screen shot 2018-09-19 at 12 24 28 pm

@geminoa
Copy link
Collaborator Author

geminoa commented Sep 20, 2018

@micahstubbs thanks for your advice! I have used npm and did not understand that yarn format is required.

@micahstubbs micahstubbs merged commit 2c094aa into visjs-community:master Sep 20, 2018
@micahstubbs
Copy link
Member

@geminoa no problem 😄, thanks for the contribution!

I add this small format requirement to make the diffs smaller when we review code. (there are other benefits too 😄) the tool we use is https://prettier.io/, in case you are curious.

@micahstubbs
Copy link
Member

micahstubbs commented Sep 20, 2018

@geminoa just published a new version on npm that includes these dotLanguage penwidth enhancements 🎉 https://www.npmjs.com/package/visjs-network

@mojoaxel
Copy link

💌 Thanks @geminoa for your contribution!
This pull-request has been merge into visjs/vis-network#24

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

Successfully merging this pull request may close these issues.

3 participants