question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link area filled in black

See original GitHub issue

Same as issue #568 except using:

  • import 'jointjs/dist/joint.css'; - Makes the whole area go blank.
  • <link rel="stylesheet" href="%PUBLIC_URL%/joint.css" /> - In index.html makes the whole area go blank
  • import 'jointjs/css/themes/default.css'; - only fixes the arrow head colour. But the nodes still show

Is there something I’m missing here about using jointjs with jsx?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kumilinguscommented, Mar 24, 2022

The external CSS is not exported when you serialize a DOM node with XMLSerializer. That’s why no. 1 added fill: none as an SVG DOM attribute to every link and no 2. inserted <style> tag inside the exported SVG.

1reaction
kumilinguscommented, Mar 24, 2022

You are missing CSS rules (https://github.com/clientIO/joint/blob/master/css/layout.css#L101-L104) in the exported SVG.

  1. Add the missing fill: none to .connection-wrap to the shape definition.
 attrs: { 
  text: {
    fill: '#000000',
    fontSize: 10,
    textAnchor: 'middle',
    textVerticalAnchor: 'middle',
    yAlignment: 'bottom',
    pointerEvents: 'cell:pointerdblclick',
    cursor: "move",
  },
  '.connection': {
      'fill': 'none',
      'stroke-linejoin': 'round',
      'stroke-width': '2',
      'stroke': '#4b4a67', // '#7a7e9b'
  },
  '.connection-wrap': {
     'fill': 'none'
  }
},
  1. Export the missing CSS as part of the paper
const linkStyle = V.createSVGStyle(`
  .joint-link .connection-wrap,
  .joint-link .connection {
    fill: red;
  }
`);
paper.svg.prepend(linkStyle);
// export the SVG
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fill the region with Black color - html
I want to fill the entire red box region with black background color. Html code: ` <body background="black"> <div id ...
Read more >
The Many Ways to Link Up Shapes and Images with HTML ...
The Many Ways to Link Up Shapes and Images with HTML and CSS ... However, you can also control the shape of that...
Read more >
Photoshop opens PDF with transparent area filled in Black?
It's just Photoshop is showing the transparent pixels as black since the preference wasn't set properly. Photoshop by default shows transparency as the...
Read more >
Link block
Select the Link block; Go to the Style Panel; Change text decoration to none; Change the font color to black. The typography section...
Read more >
Black Holes | Science Mission Directorate
This chart shows the relative masses of super-dense cosmic objects. Read the full article. Historically, astronomers have long believed that no mid-sized black...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found