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 other forms of node selection for init() #135

Merged
merged 1 commit into from
Mar 10, 2015

Conversation

bollwyvl
Copy link
Contributor

The existing behavior of init will always re-render the whole page, and requires that a chart be classed mermaid.

This change allows the user to specify:

  • a DOM Node (as from getQuerySelector)
  • a DOM NodeList (as from getQuerySelectorAll)
  • an array of nodes (as from jQuery.find)
  • a string (to be handed to getQuerySelectorAll)

As suggested in #37.

Again, can add tests if desired.

The existing behavior of init will always re-render the whole page, and requires that a chart be classed `mermaid`.

This change allows the user to specify:
- a DOM Node (as from getQuerySelector)
- a DOM NodeList  (as from getQuerySelectorAll)
- an array of nodes (as from jQuery.find)
- a string (to be handed to getQuerySelectorAll)
@knsv
Copy link
Collaborator

knsv commented Mar 10, 2015

Good idea! Will merge!

knsv added a commit that referenced this pull request Mar 10, 2015
Allow other forms of node selection for init()
@knsv knsv merged commit b0cf983 into mermaid-js:master Mar 10, 2015
@knsv
Copy link
Collaborator

knsv commented Mar 10, 2015

Could you add this info to the usage information in the gh-pages branch? Edit the md page, I can generate updated html pages once the md file is update. And again, thanks for your effort!

@bollwyvl
Copy link
Contributor Author

I'm on it...

On Tue, Mar 10, 2015 at 3:11 PM, Knut Sveidqvist notifications@github.com
wrote:

Could you add this info to the usage information in the gh-pages branch?
Edit the md page, I can generate updated html pages once the md file is
update. And again, thanks for your effort!


Reply to this email directly or view it on GitHub
#135 (comment).

@bollwyvl
Copy link
Contributor Author

Oooh, I didn't see the global.init wrapper, so the change probably isn't propagating out to what the user sees as mermaid.init.

@knsv
Copy link
Collaborator

knsv commented Mar 10, 2015

Np but you are you are right. :)

Do you want to fix the array, if not I can do it.

I think the whole handling of arguments to init needs an update. Right now, apart from the array in the global wrapper there is also inconsistent behaviour with handling of the configurations between sequence diagrams, flowcharts and gantt diagrams.

@bollwyvl
Copy link
Contributor Author

i'll submit a second PR with the API fix, but yeah, that's an issue...

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