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

Edge labels not visible in Next.js builds #305

Open
wasimsandhu opened this issue Jan 31, 2025 · 0 comments
Open

Edge labels not visible in Next.js builds #305

wasimsandhu opened this issue Jan 31, 2025 · 0 comments

Comments

@wasimsandhu
Copy link

wasimsandhu commented Jan 31, 2025

Describe the bug

I am unable to render edge labels for my graph's edges in a Next.js app.

This is a technically a duplicate of #93, which was fixed and closed sometime a year ago. The same bug is once again reproducible in both the development and production server.

Steps to Reproduce the Bug or Issue

Code (same as in #93):

import dynamic from "next/dynamic";

const GraphCanvas = dynamic(
  import("reagraph").then((mod) => mod.GraphCanvas),
  { ssr: false }
);

export default function Test() {
  return (
    <GraphCanvas
      labelType="all"
      nodes={[
        {
          id: "n-1",
          label: "1",
        },
        {
          id: "n-2",
          label: "2",
        },
      ]}
      edges={[
        {
          id: "1->2",
          source: "n-1",
          target: "n-2",
          label: "Edge 1-2",
        },
      ]}
    />
  );
}

Strangely, if I use labelType="all" or labelType="auto", then all of the edge labels appear in the center of the graph.

Expected behavior

The edge labels should be rendered appropriately.

Screenshots or Videos

Screenshot 2024-12-11 at 4 27 29 PM

Platform

  • Reagraph Version: 4.21.0
  • Next.js Version: 14.2.16
  • OS: macOS
  • Browser: Chrome
  • NodeJS version: 20.18

Your Example Website or App

No response

Additional context

For anyone who comes across this, I ended up switching to react-flow because of this issue.

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

1 participant