sigma.js icon indicating copy to clipboard operation
sigma.js copied to clipboard

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

Open shradha0810 opened this issue 1 year ago • 1 comments

I am using sigma.js graph in my react project I want to use image node program with some padding. So I tried implementing according to the storybook examples but I keep on getting this error I tried solving it but I am not able to Screenshot 2024-09-13 143706

If I am doing anything wrong please recommend changes.This is my initialization for nodeProgram and used imports and I am using dependency "@react-sigma/core" for rendering graph.

import { createNodeImageProgram, NodeImageProgram } from "@sigma/node-image";
import { NodeCircleProgram, createNodeCompoundProgram } from "sigma/rendering";

  const paddingProgram = useMemo(() => {
    return createNodeImageProgram({
      padding: 0.1,
      objectFit: "contain",
      correctCentering: true,
      // drawingMode: "color",
    });
  }, []);
  const NodeProgram = useMemo(() => {
    return createNodeCompoundProgram([NodeCircleProgram, paddingProgram]);
  }, []);
  
  <SigmaContainer
          settings={{
            allowInvalidContainer: true,
            defaultNodeType: "image",
            defaultEdgeType: "arrow",
            nodeProgramClasses: {
              image: NodeImageProgram,
              padding: NodeProgram,
            },
          }}
        >

shradha0810 avatar Sep 13 '24 09:09 shradha0810

Hi,

I tried to reproduce your error, but without success. You can take a look at this code sandbox : https://codesandbox.io/p/sandbox/sigma-issues-1464-96vcp9

If you want to continue the discussion, can you create a ticket on react-sigma instead ? (I think it's more related to it than to sigma itself).

Thanks !

sim51 avatar Sep 16 '24 12:09 sim51

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 28 '24 21:10 stale[bot]