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

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

Open
shradha0810 opened this issue Sep 13, 2024 · 1 comment
Open

Comments

@shradha0810
Copy link

shradha0810 commented Sep 13, 2024

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,
            },
          }}
        >
@sim51
Copy link
Collaborator

sim51 commented Sep 16, 2024

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 !

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