4

I must be just missing it somewhere but how does one define a hairline stroke in Joint.js? My shapes and lines are not scaled and no matter what I do, everything seems to be rendered 2px anti-aliased.

Here's my default link styling:

joint.shapes.myBase.Link = joint.dia.Link.extend({
  defaults: joint.util.deepSupplement({
    type: 'myBase.Link',
    router: {
      name: 'manhattan'
    },
    labels: [{
        attrs: {
          text: {
            'font-size': 12
          }
        }
    }],
    attrs: {
      '.marker-target': { d: 'M 10 0 L 0 5 L 10 10 z' },
      '.marker-arrowhead-group-source': { display: 'none' }
    }
  }, joint.dia.Link.extend.prototype.defaults)
});

Here's my CSS:

.connection {
  stroke-width: 1;
  stroke-opacity: 1;
  fill: none;
}
John Slegers
  • 45,213
  • 22
  • 199
  • 169
Buta
  • 73
  • 1
  • 4

0 Answers0