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

Links between nodes not showing up. #393

Closed
IndraPriyaDarshini opened this issue Feb 12, 2020 · 6 comments
Closed

Links between nodes not showing up. #393

IndraPriyaDarshini opened this issue Feb 12, 2020 · 6 comments

Comments

@IndraPriyaDarshini
Copy link

Hi,
I'm using dagre-d3 with angular 8 and following are the issues I'm facing

Problems:
Links are not appearing between the nodes.
Labels on the nodes are not visible.

https://codesandbox.io/s/angular-graph-kq2nb

@IndraPriyaDarshini IndraPriyaDarshini changed the title Arrowheads not showing up Links between nodes not showing up. Feb 12, 2020
@gordonwoodhull
Copy link
Contributor

Looks like the demos rely on CSS to make this stuff visible. See e.g.

.node rect,
.node circle,
.node ellipse {
stroke: #333;
fill: #fff;
stroke-width: 1.5px;
}
.cluster rect {
stroke: #333;
fill: #000;
fill-opacity: 0.1;
stroke-width: 1.5px;
}
.edgePath path.path {
stroke: #333;
stroke-width: 1.5px;
fill: none;
}

@IndraPriyaDarshini
Copy link
Author

Hi Gordonwoodhull,

I tried your suggestion but problem still exists.

https://codesandbox.io/s/angular-graph-kq2nb

In the above link open the app folder under src folder where we can find the actual code.

app.component.css for CSS and app.component.ts for TS

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Feb 12, 2020

Huh? Your link shows a graph with links and node labels visible.

image

@IndraPriyaDarshini
Copy link
Author

Hmm. May I know in which browser you are viewing it.

I'm not able to see the above graph in Chrome.

https://codesandbox.io/s/angular-graph-kq2nb
image

@gordonwoodhull
Copy link
Contributor

gordonwoodhull commented Feb 12, 2020

Must be some caching issue.

Anyway, that is definitely how to get the nodes and links to show in dagre-d3. Figuring out how to get CSS to correctly apply inside of Angular and codesandbox.io is out of scope for this repo.

In Chrome, Firefox, and Safari, pasting the following CSS into styles.css, and then pressing enter, will work:

.node rect {
  stroke: #333;
  fill: #fff;
}

.edgePath path {
  stroke: #333;
  fill: #333;
  stroke-width: 1.5px;
}

Probably Angular transforms the CSS in app.component.css in some way that makes it not work.

@IndraPriyaDarshini
Copy link
Author

IndraPriyaDarshini commented Feb 12, 2020

Ok. Figured it out. Need to put encapsulation: ViewEncapsulation.None

https://codesandbox.io/s/angular-graph-kq2nb

Thank you for the quick help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants