sim51 / react-sigma

Sigma React component
https://sim51.github.io/react-sigma/
MIT License
172 stars 27 forks source link

Sigma: could not find a suitable program for node type "pictogram"! #70

Open shinhanbyeol opened 3 months ago

shinhanbyeol commented 3 months ago

A node program class named "pictogram" has been defined but cannot be found.

May I know the cause?

Sigma: could not find a suitable program for node type "pictogram"!

Modification of the node default color in the settings has no effect

Sigma.js version: 3.0.0-beta.20 react sigma version : 4.0.2 Graphology version: 0.24.7 Operating System: OSX Web browser: Chrome

image

image

The program definition is

defined by using border and image createNodeBorderProgram createNodeImageProgram

const NodeBorderCustomProgram = createNodeBorderProgram({
  borders: [
    { size: { value: 0.25 }, color: { attribute: 'labelColor' } },
    { size: { fill: true }, color: { attribute: 'color' } },
  ],
});

const NodePictogramCustomProgram = createNodeImageProgram({
  padding: 0.6,
  size: { mode: 'force', value: 256 },
  drawingMode: 'color',
  colorAttribute: 'iconColor',
});

const NodeProgram = createNodeCompoundProgram([
  NodeBorderCustomProgram,
  NodePictogramCustomProgram,
]);
shinhanbyeol commented 2 months ago

allowInvalidContainer=true to the values in the settings I've solved this problem by that away. Is this the right way to solve it?

sim51 commented 2 months ago

Sorry for the lag. For me it's weird that this setting fixes your issue, it should not be related. Can you try to remove it, and put your sigma's settings into a useMemo to see if it solves your issue ?