How highcharts/highcharts-editor works
Project Type and Purpose
• This is a client‐side, embeddable chart editor library for Highcharts. It provides a stand‐alone web UI component (no backend needed by default) that can be integrated into frameworks (TinyMCE, CKEditor, WordPress, Electron, etc.) or run as a demo site via a simple Express server.
File Structure Analysis
• Top-level:
• src/ — core JavaScript modules, UI widgets, editors, meta definitions, product bundles
• less/ — all UI styles in Less
• views/ — Handlebars templates for the demo server
• integrations/ — example integration code for TinyMCE, CKEditor, WordPress, Electron
• plugins/ — extension hooks (data sources, export formats)
• app/ — standalone demo client (index.html + main.js + jquery-simple-rest)
• bin/ — CLI scripts (Express server launcher, HTTP entry point)
• tools/, gulpfile.js, highed.config.js — build scripts, tasks, configuration
• dictionaries/, localization/ — static data for settings and i18n
• Build outputs (not in tree): dist/ folder with minified JS/CSS bundles after running gulp.
README Insights
• It’s entirely client-side, zero-back-end architecture by default.
• Build tasks compile and concatenate src/, less/, templates into single files:
– highcharts-editor.min.js
– highcharts-editor.min.css
– product bundles (with default templates or advanced mode)
• Demo server (bin/www) serves unminified source for development and auto-bakes Less.
Main Components
a. Source Modules (src/, less/, templates)
b. Build Pipeline (gulp + tools/*)
c. Distribution Bundles (JS, CSS, product bundles)
d. Demo/Dev Server (Express in bin/www + views/)
e. Embedding Targets (app/, integrations/*)
f. External Dependencies (Highcharts library, FontAwesome, Google Fonts, Highcharts Cloud)
g. Plugins & Extensions (plugins/, dictionaries/, localization/)
Relationships and Interactions
• Distribution Bundles feed both the Demo Server (views/ + app/) and Integrations.
• Plugins and dictionaries are loaded at build time (via tools/gen.localization.js, etc.) or at runtime by the editor.
• Demo Server at runtime serves the HTML+bundles; user interacts with UI widgets which emit events processed by core modules and Highcharts API.
• Embedding Targets (WordPress plugin, TinyMCE adaptor) simply include the bundles and call highed.Editor(...) to initialize.
Architectural Patterns and Principles
• Modular architecture: UI widgets (core-ui/) separated from core logic (core/), editors (src/editors/) and product templates (src/products/).
• Plugin system: dynamic loading of data sources and export formats.
• Build-time composition: Handlebars templates pulled into product bundles.
• Clear separation of concerns: styling in less/, markup in views/, logic in src/.
Technologies and Frameworks
• Node.js + Express (dev server)
• Gulp (build system)
• Handlebars (HTML templating)
• Less (styles)
• jQuery (simple REST client in app/)
• Highcharts (chart rendering)
• FontAwesome, Google Fonts (UI assets)