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

allow option-object in toString to insert namespace and style #53

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open

Conversation

mw75
Copy link

@mw75 mw75 commented Apr 4, 2018

solves #36 in a generic way

const css=[
    '.railroad-diagram {',
    '    background-color: hsl(30,20%,95%);',
    '}',
    '.railroad-diagram path {',
    '    stroke-width: 3;',
    '    stroke: black;',
    '    fill: rgba(0,0,0,0);',
    '}',
    '.railroad-diagram text {',
    '    font: bold 14px monospace;',
    '    text-anchor: middle;',
    '}',
    '.railroad-diagram text.label {',
    '    text-anchor: start;',
    '}',
    '.railroad-diagram text.comment {',
    '    font: italic 12px monospace;',
    '}',
    '.railroad-diagram rect {',
    '    stroke-width: 3;',
    '    stroke: black;',
    '    fill: hsl(120,100%,90%);',
    '}'].join("\n");
const svgattr='xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"';
const standaloneSVG=Diagram().format().toString({css,svgattr});```

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