You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is selfish, but with our R htmlwidget, we need to render each diagram one by one rather than the total sweep behavior expected by mermaid. Due to this, the internal counter i will result in duplicated id for mermaidChart*, so we change the id. We love the new cluster ability, but in these lines, the setTimeout will multiple diagrams on a page causes trouble even if we set our timeout > 20. I'm not a JavaScript pro, but I think this can be handled without negative consequence by very gently changing the setTimeout in the lines referenced above to be.
setTimeout(function(el){
debugger;
var i = 0;
subGraphs.forEach(function(subG){
var clusterRects = el.querySelectorAll('.clusters rect');
var clusters = el.querySelectorAll('.cluster');
if(subG.title !== 'undefined'){
var xPos = clusterRects[i].x.baseVal.value;
var yPos = clusterRects[i].y.baseVal.value;
var width = clusterRects[i].width.baseVal.value;
var cluster = d3.select(clusters[i]);
var te = cluster.append('text');
te.attr('x', xPos+width/2);
te.attr('y', yPos +14);
te.attr('fill', 'black');
te.attr('stroke','none');
te.attr('id', id+'Text');
te.style('text-anchor', 'middle');
te.text(subG.title);
}
i = i + 1;
});
}(svg[0][0]),20);
};
Thanks so much for your incredible package. It is gaining quick traction in the R community with our DiagrammeR htmlwidget wrapper.
The text was updated successfully, but these errors were encountered:
This is selfish, but with our
R
htmlwidget, we need to render each diagram one by one rather than the total sweep behavior expected bymermaid
. Due to this, the internal counteri
will result in duplicatedid
formermaidChart*
, so we change the id. We love the newcluster
ability, but in these lines, thesetTimeout
will multiple diagrams on a page causes trouble even if we set our timeout > 20. I'm not a JavaScript pro, but I think this can be handled without negative consequence by very gently changing thesetTimeout
in the lines referenced above to be.Thanks so much for your incredible package. It is gaining quick traction in the
R
community with ourDiagrammeR
htmlwidget wrapper.The text was updated successfully, but these errors were encountered: