Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cognitedata avatar

Graph Viewer

  • 1.9k installs
  • 5 repo stars
  • Updated August 4, 2026
  • cognitedata/builder-skills

graph-viewer is an agent skill that Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle. Use when emb.

About

The user wants to embed an interactive graph of a CDF data model nodes direct relations edges and reverse relations inside a Flows app Do not use this skill for static diagrams pure dataflow visualizations or non CDF graphs The app is wrapped in cognite dune s DuneProvider so useDune returns an authenticated SDK The target data model exists in CDF and you know its space externalId and version The app uses React 18 and TypeScript Follow these steps in order Adapt to the target repo s conventions instead of inventing new ones 1 Inspect the target app Read package json and look at the existing folder structure e g src features src components path aliases like 2 Install missing dependencies with the app s package manager npm pnpm yarn See the Dependencies dependencies table below for purposes and suggested versions Reuse the React version already pinned by the app rather than upgrading it and prefer any versions the repo already pins over the suggestions here 3 Copy the bundle

  • description: Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle.
  • The user wants to embed an interactive graph of a CDF data model — nodes, direct relations, edges, and reverse relations
  • Do **not** use this skill for static diagrams, pure dataflow visualizations, or non-CDF graphs.
  • Follow graph-viewer SKILL.md steps and documented constraints.
  • Follow graph-viewer SKILL.md steps and documented constraints.

Graph Viewer by the numbers

  • 1,874 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #683 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

graph-viewer capabilities & compatibility

Capabilities
description: integrate the reusable cdf graph vi · the user wants to embed an interactive graph of · do **not** use this skill for static diagrams, p · follow graph viewer skill.md steps and documente
Use cases
orchestration
From the docs

What graph-viewer says it does

description: Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle. Use when embedding a graph visualization, adding a knowledge graph, or showing
SKILL.md
The user wants to embed an interactive graph of a CDF data model — nodes, direct relations, edges, and reverse relations — inside a Flows app.
SKILL.md
Do **not** use this skill for static diagrams, pure dataflow visualizations, or non-CDF graphs.
SKILL.md
npx skills add https://github.com/cognitedata/builder-skills --skill graph-viewer

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.9k
repo stars5
Security audit3 / 3 scanners passed
Last updatedAugust 4, 2026
Repositorycognitedata/builder-skills

When should an agent use graph-viewer and what problem does it solve?

Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle. Use when embedding a graph visualization, adding a knowledge graph, or showing CDF data mode

Who is it for?

Developers invoking graph-viewer as documented in the skill source.

Skip if: Skip when requirements fall outside graph-viewer documented scope.

When should I use this skill?

Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle. Use when embedding a graph visualization, adding a knowledge graph, or showing CDF data mode

What you get

Outputs aligned with the graph-viewer SKILL.md workflow and stated deliverables.

  • Graph viewer components
  • Theme and palette configuration

By the numbers

  • Default iconSize 64 and pathHighlightSize 3 in DEFAULT_VISUAL_CONFIG
  • Default pathHighlightColor #22c55e for highlighted graph paths

Files

SKILL.mdMarkdownGitHub ↗

Graph Viewer

Use This When

The user wants to embed an interactive graph of a CDF data model — nodes, direct relations, edges, and reverse relations — inside a Flows app.

Do not use this skill for static diagrams, pure dataflow visualizations, or non-CDF graphs.

Prerequisites

  • The app is wrapped in @cognite/dune's <DuneProvider> so useDune() returns an authenticated SDK.
  • The target data model exists in CDF and you know its space, externalId, and version.
  • The app uses React 18+ and TypeScript.

Integration Workflow

Follow these steps in order. Adapt to the target repo's conventions instead of inventing new ones.

1. Inspect the target app. Read package.json and look at the existing folder structure (e.g. src/features/*, src/components/*, path aliases like @/*). 2. Install missing dependencies with the app's package manager (npm, pnpm, yarn, …). See the Dependencies table below for purposes and suggested versions. Reuse the React version already pinned by the app rather than upgrading it, and prefer any versions the repo already pins over the suggestions here. 3. Copy the bundle into the app. Copy every file from skills/graph-viewer/code/ into an app-local feature folder, for example:

   src/features/graph-viewer/

If the repo already has a different feature/components layout or alias, mirror it. 4. Import from the local folder, never from @skills/.... With a typical @/* alias:

   import { useGraphViewer } from "@/features/graph-viewer";

5. Render `GraphCanvas` inside a container with explicit dimensions (height is required — see the minimal example below). 6. Run typecheck and build (tsc --noEmit, npm run build, etc.) and fix any path or type issues introduced by the copy.

Minimal Example

import { useGraphViewer } from "@/features/graph-viewer";

export function GraphPanel() {
  const { GraphCanvas, isLoading, error } = useGraphViewer({
    dataModel: { space: "my-space", externalId: "my-data-model", version: "1" },
    instance: { space: "my-instance-space", externalId: "pump-001" },
  });

  if (isLoading) return <div>Loading graph…</div>;
  if (error) return <div>Error: {error}</div>;

  return <GraphCanvas className="h-[600px] w-full" />;
}

Dependencies

Suggested versions reflect the latest published majors at the time of writing. They are starting points — if the target app already pins different versions, defer to the app.

PackageSuggested versionPurpose
react^18.2.0UI framework (peer; reuse the app's version)
@cognite/sdk^10.10.0CDF API client (instances, data models)
@cognite/dune^2.1.0Provides the authenticated SDK via useDune()
reagraph^4.30.8WebGL graph rendering engine
lucide-react^1.14.0Icon set used by the node-type legend

Example install (npm; adapt to the app's package manager):

npm install @cognite/sdk@^10.10.0 @cognite/dune@^2.1.0 reagraph@^4.30.8 lucide-react@^1.14.0

CDF Cost & Performance

Graph expansion can issue many CDF requests, especially with reverse relations. For large or unfamiliar data models, be conservative:

  • Set whitelistedRelationProps to the few properties the app actually needs to traverse.
  • Lower initialConnectionLimit (it is a hard maximum of connections fetched per expansion).
  • Lower maxNodes to bound the in-memory LRU buffer.
  • Only declare coreReverseQueries for relations the app must surface; each entry adds an extra query per expansion.

Tuples in coreReverseQueries are version-aware: [space, viewExternalId, viewVersion, propertyName, isList].

Advanced Reference

For full configuration tables, return-value docs, layouts, theming, and richer examples, read code/README.md.

For implementation details, inspect the source files under code/.

Verification Checklist

  • [ ] The app is wrapped in <DuneProvider>.
  • [ ] All files from skills/graph-viewer/code/ were copied into an app-local folder.
  • [ ] Imports point to the app-local folder (e.g. @/features/graph-viewer), not @skills/....
  • [ ] @cognite/dune, @cognite/sdk, reagraph, and lucide-react are present in package.json.
  • [ ] The container that renders <GraphCanvas> has an explicit height.
  • [ ] tsc --noEmit and the app's build both pass.
  • [ ] No references to dune-industrial-components were introduced.

Related skills

FAQ

What is graph-viewer?

Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle. Use when embedding a graph visualization, adding a knowledge graph, or s

When should I use graph-viewer?

Integrate the reusable CDF graph viewer (useGraphViewer) into a Flows app by copying the local code bundle. Use when embedding a graph visualization, adding a knowledge graph, or s

Is graph-viewer safe to install?

Review the Security Audits panel on this page before production use.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.