Skip to content

kernt07/filled-shape-plugin

Repository files navigation

Filled Shape Chart Sigma Plugin

Custom Sigma plugin that renders a percentage-filled shape chart from workbook data.

Local development

  1. Install dependencies:
    • npm install
  2. Run dev server:
    • npm run dev
  3. Plugin serves at:
    • http://localhost:3001

Sigma setup checklist

  1. Open workbook in Edit mode.
  2. Add plugin element (Sigma Plugin Dev Playground or your registered plugin).
  3. Point development URL to http://localhost:3001 if needed.
  4. Configure plugin editor fields:
    • data source -> table/chart element with source data
    • label column -> category label
    • value column -> numeric percentage (0-100 preferred)
    • background color, shape color, fill color
    • shape URL (optional persistent URL)
  5. Upload a local PNG in the plugin UI if desired:
    • Stored as base64 in shape image base64 config to persist across reloads.

Data mapping

  • One row = one rendered shape.
  • label column drives the shape caption.
  • value column drives fill height.
  • Values are clamped to [0, 100].

Selection and actions

  • Clicking a shape updates the shape selected interaction.
  • Clicking a shape also fires shape click trigger action.
  • In Sigma actions UI, use the plugin trigger to target controls/charts.

Notes

  • Uploaded base64 shape has precedence over URL shape.
  • If no uploaded shape exists, shape URL is used as fallback.

Deploy on Netlify (no localhost)

  1. Sign in at Netlify (free tier is fine).
  2. Add new siteImport an existing projectGitHub.
  3. Authorize Netlify for your GitHub account and pick repo kernt07/filled-shape-plugin.
  4. Netlify reads netlify.toml: build command npm run build, publish folder dist.
  5. Deploy. Copy the site URL (e.g. https://filled-shape-plugin.netlify.app).
  6. In Sigma, set your custom plugin Production URL to that HTTPS URL (or point a plugin element to it).

React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

About

A simple plugin for creating filled-shape charts in Sigma

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors