https://github.com/dsnchz/solid-highcharts

A SolidJS wrapper for Highcharts with full reactivity, lifecycle management, and TypeScript support.

https://github.com/dsnchz/solid-highcharts

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.2%) to scientific vocabulary

Keywords

analysis charting-library charts charts-api data-visualization finance solidjs visualization
Last synced: 5 months ago · JSON representation

Repository

A SolidJS wrapper for Highcharts with full reactivity, lifecycle management, and TypeScript support.

Basic Info
  • Host: GitHub
  • Owner: dsnchz
  • License: mit
  • Language: TypeScript
  • Default Branch: main
  • Homepage:
  • Size: 106 KB
Statistics
  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
analysis charting-library charts charts-api data-visualization finance solidjs visualization
Created 9 months ago · Last pushed 8 months ago
Metadata Files
Readme Changelog License Codeowners

README.md

solid-highcharts

@dschz/solid-highcharts

License Highcharts npm version Bundle Size JSR CI Discord

A comprehensive SolidJS wrapper for Highcharts that provides type-safe, reactive chart components with proper lifecycle management.

✨ Features

  • 🎯 Type-Safe: Full TypeScript support with proper type inference
  • Reactive: Seamless integration with SolidJS reactivity system
  • 🏗️ Modular: Support for all Highcharts variants (Core, Stock, Maps, Gantt)
  • 🧹 Clean: Automatic cleanup and memory management
  • 📱 Responsive: Built-in responsive chart behavior
  • 🎨 Customizable: Full access to Highcharts configuration options

⚖️ Licensing

Important: This wrapper library (@dschz/solid-highcharts) is MIT licensed, but Highcharts itself is a commercial product that requires a license for most use cases.

Highcharts Licensing

  • 🏢 Commercial Use: Requires a Highcharts license for commercial projects
  • 🎓 Non-Commercial: Free for personal projects, school websites, and non-profit organizations
  • 🧪 Evaluation: Free for testing and evaluation purposes

License Requirements by Use Case

| Use Case | Highcharts License Required | | -------------------------------- | --------------------------- | | Personal/hobby projects | ❌ Free | | Educational/school websites | ❌ Free | | Non-profit organizations | ❌ Free | | Commercial websites/applications | ✅ License Required | | SaaS products | ✅ License Required | | Products for sale | ✅ License Required |

📋 Before using Highcharts in your project, please review the official Highcharts license terms to determine if you need to purchase a license.

This wrapper library simply provides SolidJS integration - all Highcharts licensing terms apply to your usage of the underlying Highcharts library.

📦 Installation

```bash

Using npm

npm install highcharts @dschz/solid-highcharts

Using yarn

yarn install highcharts @dschz/solid-highcharts

Using pnpm

pnpm install highcharts @dschz/solid-highcharts

Using bun

bun install highcharts @dschz/solid-highcharts ```

Highcharts Module Usage

All Highcharts functionality is available from the single highcharts package via different import paths.

⚠️ Important: Import order matters! Highcharts modules must be imported after the core module.

📦 Highcharts v12+: As of Highcharts version 12, you should use ESM import paths for better compatibility and tree-shaking. The examples below show the recommended ESM imports.

```tsx // Core Highcharts (standard charts) - ESM import import Highcharts from "highcharts/esm/highcharts";

// Stock Charts (financial/time-series data) - ESM import import HighchartsStock from "highcharts/esm/highstock";

// Maps (geographical data) - ESM import import HighchartsMaps from "highcharts/esm/highmaps";

// Gantt Charts (project timelines) - ESM import import HighchartsGantt from "highcharts/esm/highcharts-gantt";

// Additional modules (optional) -- ORDER MATTERS! MUST BE IMPORTED AFTER Highcharts IMPORT! import "highcharts/esm/modules/accessibility"; import "highcharts/esm/modules/exporting"; import "highcharts/esm/modules/export-data"; ```

See this post for more details.

Legacy UMD imports (pre-v12) are still supported but ESM is recommended:

```tsx // Legacy UMD imports (still works but not recommended) import Highcharts from "highcharts"; import HighchartsStock from "highcharts/highstock"; import HighchartsMaps from "highcharts/highmaps"; import HighchartsGantt from "highcharts/highcharts-gantt";

// Additional modules (optional) -- ORDER MATTERS! MUST BE IMPORTED AFTER Highcharts IMPORT! import "highcharts/modules/accessibility"; import "highcharts/modules/exporting"; import "highcharts/modules/export-data"; ```

API Quick Start

This library exposes four factory functions that create the Highcharts components to use in your Solid application.

Basic Chart

```tsx import Highcharts from "highcharts/esm/highcharts"; import { createChart } from "@dschz/solid-highcharts";

// Highcharts Chart component const Chart = createChart(Highcharts); ```

Stock Chart

```tsx // To create a StockChart import Highcharts from "highcharts/esm/highstock"; import { createStockChart } from "@dschz/solid-highcharts";

// Highcharts StockChart component const StockChart = createStockChart(Highcharts); ```

Map Chart

```tsx // To create a MapChart import Highcharts from "highcharts/esm/highmaps"; import { createMapChart } from "@dschz/solid-highcharts";

// Highcharts MapChart component const MapChart = createMapChart(Highcharts); ```

Gantt Chart

```tsx // To create a GanttChart import Highcharts from "highcharts/esm/highcharts-gantt"; import { createGanttChart } from "@dschz/solid-highcharts";

// Highcharts GanttChart component const GanttChart = createGanttChart(Highcharts); ```

Accessibility / Exporting Modules

For additional modules like exporting and accessibility, you simply import them to register with Highcharts:

```tsx import Highcharts from "highcharts/esm/highcharts"; import "highcharts/esm/modules/accessibility"; import "highcharts/esm/modules/exporting"; import "highcharts/esm/modules/export-data";

import { createChart } from "@dschz/solid-highcharts";

const Chart = createChart(Highcharts); ```

Note: You may need to disable import sorting rules (like simple-import-sort or Prettier) for these imports to prevent automatic reordering that would break functionality as the additional modules must be imported AFTER the target Highcharts module import.

🔧 Component Props

All chart components returned from the factory functions accept the same props interface:

```tsx type HighchartOptions = Highcharts.Options & { animation?: boolean | Partial; };

type HighchartsComponentProps = HighchartOptions & { /** CSS class for container */ class?: string;

/** CSS styles for container */ style?: JSX.CSSProperties;

/** Access to container element */ ref?: (container: HTMLDivElement) => void;

/** Callback when chart is created */ onCreateChart?: (chart: Highcharts.Chart) => void; }; ```

Props Examples

```tsx // Basic styling

// Chart reference and callbacks console.log('Container:', container)} onCreateChart={(chart) => { // Access chart instance chart.setTitle({ text: 'Updated Title' });

// Add custom event listeners
chart.container.addEventListener('click', () => {
  console.log('Chart clicked!');
});

}} series={[{ type: 'line', data: [1, 2, 3] }]} /> ```

🎨 Styling and Theming

CSS Styling

```css /* Global chart container styles */ .highcharts-container { border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }

/* Custom chart class */ .my-chart { background: #f5f5f5; padding: 16px; }

/* Responsive behavior */ .chart-responsive { width: 100%; height: 400px; min-height: 300px; }

@media (max-width: 768px) { .chart-responsive { height: 300px; } } ```

Highcharts Theming

```tsx import Highcharts from "highcharts/esm/highcharts"; import { createChart } from "@dschz/solid-highcharts";

// Apply global theme Highcharts.setOptions({ colors: ["#058DC7", "#50B432", "#ED561B", "#DDDF00"], chart: { backgroundColor: "#f9f9f9", style: { fontFamily: "Inter, sans-serif", }, }, title: { style: { color: "#333", fontSize: "18px", }, }, });

const Chart = createChart(Highcharts); ```

📈 Performance Tips

1. Use Chart Boost for Large Datasets

```tsx import Highcharts from "highcharts/esm/highcharts"; import "highcharts/esm/modules/boost";

; ```

🤝 Contributing

All contributions are welcome! Please see our Contributing Guide for details.

Development Setup

```bash

Clone the repository

git clone https://github.com/dsnchz/solid-highcharts.git cd solid-highcharts

Install dependencies

bun install

Run tests

bun test

Build the library

bun run build

Start development server

bun start ```

📄 License

MIT © Daniel Sanchez

Owner

  • Name: dsnchz
  • Login: dsnchz
  • Kind: organization

GitHub Events

Total
  • Release event: 3
  • Watch event: 2
  • Push event: 5
  • Public event: 1
  • Create event: 2
Last Year
  • Release event: 3
  • Watch event: 2
  • Push event: 5
  • Public event: 1
  • Create event: 2

Packages

  • Total packages: 1
  • Total downloads:
    • npm 13 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
npmjs.org: @dschz/solid-highcharts

SolidJS wrapper for Highcharts

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 13 Last month
Rankings
Dependent repos count: 24.5%
Average: 29.9%
Dependent packages count: 35.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yaml actions
  • actions/checkout v4 composite
  • oven-sh/setup-bun v1 composite
package.json npm
  • @changesets/cli ^2.29.3 development
  • @solidjs/router ^0.15.3 development
  • @solidjs/testing-library ^0.8.10 development
  • @tailwindcss/vite ^4.1.5 development
  • @testing-library/jest-dom ^6.6.3 development
  • @types/bun ^1.2.12 development
  • @typescript-eslint/eslint-plugin ^8.32.0 development
  • @typescript-eslint/parser ^8.32.0 development
  • @vitest/coverage-istanbul ^3.1.3 development
  • eslint ^9.26.0 development
  • eslint-plugin-simple-import-sort ^12.1.1 development
  • eslint-plugin-solid ^0.14.5 development
  • globals ^16.1.0 development
  • highcharts ^12.2.0 development
  • jiti ^2.4.2 development
  • jsdom ^26.1.0 development
  • prettier ^3.5.3 development
  • solid-js ^1.9.6 development
  • tailwindcss ^4.1.5 development
  • tsup ^8.4.0 development
  • tsup-preset-solid ^2.2.0 development
  • typescript ^5.8.3 development
  • typescript-eslint ^8.32.0 development
  • vite ^6.3.5 development
  • vite-plugin-solid ^2.11.6 development
  • vitest ^3.1.3 development