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

Require d3 directly to better support Node usage #107

Merged
merged 1 commit into from
Jan 20, 2015

Conversation

markdalgleish
Copy link
Contributor

Node consumers should only have to run require("mermaid"), but the current implementation assumes that the d3 global has been set up beforehand.

This change brings d3 in line with how dagre-d3 is handled internally, i.e. the d3 dependency is required directly.

In order for the existing sequenceRenderer tests to continue working, I had to introduce proxyquire so that a mock d3 could be injected.

knsv added a commit that referenced this pull request Jan 20, 2015
Require d3 directly to better support Node usage
@knsv knsv merged commit 699d3bc into mermaid-js:master Jan 20, 2015
@knsv
Copy link
Collaborator

knsv commented Jan 20, 2015

Excellent! I had a hunch that this needed to be done.

@mingfang
Copy link

I'm trying to use mermaid with webpack but proxyquire is causing problems thlorenz/proxyquire#62

Is there anyway to avoid using proxyquire?

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.

None yet

3 participants