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

fixes to address Issue #81 #83

Merged
merged 2 commits into from
Mar 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions inst/htmlwidgets/DiagrammeR.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ HTMLWidgets.widget({
// but use try catch block
// to send error to the htmlwidget for display
try{
mermaid.init();
mermaid.init( el );

// sort of make our diagram responsive
// should we make this an option?
// if so, then could easily add to list of post process tasks
makeResponsive( el );

/*
// change the id of our SVG assigned by mermaid to prevent conflict
// mermaid.init has a counter that will reset to 0
// and cause duplication of SVG id if multiple
Expand All @@ -139,8 +140,10 @@ HTMLWidgets.widget({
if(d3.select(el).select("svg").select("style")[0][0]){
d3.select(el).select("svg").select("style")[0][0].innerHTML = d3.select(el).select("svg")
.select("style")[0][0].innerHTML
.replace(/mermaidChart[0-9]*/gi, "mermaidChart-" + el.id);
}
*/
/// sep comment for / in regex .replace(/mermaidChart[0-9]*/gi, "mermaidChart-" + el.id);
/*}
*/

// set up a container for tasks to perform after completion
// one example would be add callbacks for event handling
Expand Down
5 changes: 2 additions & 3 deletions inst/htmlwidgets/lib/mermaid/dist/mermaid.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
.mermaid .label {
color: #333333;
}
.mermaid .node rect,
.node circle,
.node polygon {
.mermaid .node {
fill: #d2d2d2;
stroke: #929193;
stroke-width: 1px;
}

.mermaid .edgePath .path {
stroke: #333333 !important;
}
Expand Down
Loading