{
const margin = ({top: 30, right:30, bottom: 30, left: 30});
const barId = DOM.uid("bar");
const arrowId = DOM.uid("arrow");
const svgContainer = d3.create('svg')
.attr("viewBox", "0 0 ${width} ${height}")
.style("max-width", "${width}px")
.style("font", "10px sans-serif")
.style("overflow", "visible");
const defsContainer = svgContainer.append('defs');
const make_marker = (id) => {
const mcontainer = defsContainer.append("marker")
if (id===barId.id){
mcontainer.attr("id",id)
.attr("viewBox", "-5 -5 10 10")
.attr("markerWidth", "6")
.attr("markerHeight", "6")
.attr("orient", "auto")
const path = mcontainer.append("path");
path.attr("fill", "none")
.attr("stroke", "black")
.attr("stroke-width", "1.5")
.attr("d", "M0,5v-10")
}else{
mcontainer.attr("id", id)
.attr("viewBox", "0 0 10 10")
.attr("refx", "10")
.attr("refy", "5")
.attr("markerWidth", "6")
.attr("markerHeight", "6")
.attr("orient", "auto")
const path = mcontainer.append("path");
path.attr("d", "M0,0L10,5L010z")
}
return mcontainer;
}
make_marker(barId.id);
make_marker(arrowId.id);
const rect = svgContainer.append('rect');
rect.attr("fill", "none")
.attr("stroke", "#000")
.attr("stroke-dasharray", "1,2")
.attr("height", height)
.attr("width", width)
return svgContainer.node()
}