nteract / semiotic

A data visualization framework combining React & D3
https://semioticv1.nteract.io/
Other
2.43k stars 133 forks source link

networkFrame: enable opacity when using sketchy render mode (v2-beta-22) #517

Closed demartsc closed 4 years ago

demartsc commented 4 years ago

It seems that when you use sketchy render method opacity does not seem to be recognized. This works in render mode normal, but not in sketchy render mode (let me know if I am doing something wrong though.

nodeStyle: { fillOpacity: .25, strokeOpacity: .25 }

emeeks commented 4 years ago

As a design decision, I map opacity to roughjs settings (hachureGap) so that when you have "opacity" in normal rendering it maps to fewer lines in rough rendering.

As of 2.0.0-beta.24 I added functionality so that if you manually set hachureGap to any value or fillStyle: "solid" in your renderMode settings then it will honor the passed opacity settings.

So, for instance, if you pass the following to a network chart:

nodeRenderMode={{ renderMode: "sketchy", hachureGap: 2 }}

Then any opacity styles you pass should be honored by the sketchy marks.