|
@@ -4,87 +4,14 @@ from typing import Dict, List
|
|
|
from ..dependencies import register_library, register_vue_component
|
|
|
from ..element import Element
|
|
|
|
|
|
-dependencies = [
|
|
|
- 'lib/highcharts/highcharts.js',
|
|
|
- 'lib/highcharts/highcharts-more.js',
|
|
|
- 'lib/highcharts/highcharts-3d.js',
|
|
|
-]
|
|
|
-optional_dependencies = [
|
|
|
- 'lib/highcharts/modules/sankey.js',
|
|
|
- 'lib/highcharts/modules/accessibility.js',
|
|
|
- 'lib/highcharts/modules/exporting.js',
|
|
|
- 'lib/highcharts/modules/export-data.js',
|
|
|
- 'lib/highcharts/modules/solid-gauge.js',
|
|
|
- 'lib/highcharts/modules/annotations-advanced.js',
|
|
|
- 'lib/highcharts/modules/annotations.js',
|
|
|
- 'lib/highcharts/modules/arc-diagram.js',
|
|
|
- 'lib/highcharts/modules/arrow-symbols.js',
|
|
|
- 'lib/highcharts/modules/boost-canvas.js',
|
|
|
- 'lib/highcharts/modules/boost.js',
|
|
|
- 'lib/highcharts/modules/broken-axis.js',
|
|
|
- 'lib/highcharts/modules/bullet.js',
|
|
|
- 'lib/highcharts/modules/coloraxis.js',
|
|
|
- 'lib/highcharts/modules/current-date-indicator.js',
|
|
|
- 'lib/highcharts/modules/datagrouping.js',
|
|
|
- 'lib/highcharts/modules/data.js',
|
|
|
- 'lib/highcharts/modules/debugger.js',
|
|
|
- 'lib/highcharts/modules/dependency-wheel.js',
|
|
|
- 'lib/highcharts/modules/dotplot.js',
|
|
|
- 'lib/highcharts/modules/draggable-points.js',
|
|
|
- 'lib/highcharts/modules/drag-panes.js',
|
|
|
- 'lib/highcharts/modules/drilldown.js',
|
|
|
- 'lib/highcharts/modules/dumbbell.js',
|
|
|
- 'lib/highcharts/modules/full-screen.js',
|
|
|
- 'lib/highcharts/modules/funnel.js',
|
|
|
- 'lib/highcharts/modules/gantt.js',
|
|
|
- 'lib/highcharts/modules/grid-axis.js',
|
|
|
- 'lib/highcharts/modules/heatmap.js',
|
|
|
- 'lib/highcharts/modules/histogram-bellcurve.js',
|
|
|
- 'lib/highcharts/modules/item-series.js',
|
|
|
- 'lib/highcharts/modules/lollipop.js',
|
|
|
- 'lib/highcharts/modules/marker-clusters.js',
|
|
|
- 'lib/highcharts/modules/networkgraph.js',
|
|
|
- 'lib/highcharts/modules/no-data-to-display.js',
|
|
|
- 'lib/highcharts/modules/offline-exporting.js',
|
|
|
- 'lib/highcharts/modules/oldie.js',
|
|
|
- 'lib/highcharts/modules/oldie-polyfills.js',
|
|
|
- 'lib/highcharts/modules/organization.js',
|
|
|
- 'lib/highcharts/modules/overlapping-datalabels.js',
|
|
|
- 'lib/highcharts/modules/parallel-coordinates.js',
|
|
|
- 'lib/highcharts/modules/pareto.js',
|
|
|
- 'lib/highcharts/modules/pathfinder.js',
|
|
|
- 'lib/highcharts/modules/pattern-fill.js',
|
|
|
- 'lib/highcharts/modules/price-indicator.js',
|
|
|
- 'lib/highcharts/modules/series-label.js',
|
|
|
- 'lib/highcharts/modules/series-on-point.js',
|
|
|
- 'lib/highcharts/modules/sonification.js',
|
|
|
- 'lib/highcharts/modules/static-scale.js',
|
|
|
- 'lib/highcharts/modules/stock.js',
|
|
|
- 'lib/highcharts/modules/stock-tools.js',
|
|
|
- 'lib/highcharts/modules/streamgraph.js',
|
|
|
- 'lib/highcharts/modules/sunburst.js',
|
|
|
- 'lib/highcharts/modules/tilemap.js',
|
|
|
- 'lib/highcharts/modules/timeline.js',
|
|
|
- 'lib/highcharts/modules/treegraph.js',
|
|
|
- 'lib/highcharts/modules/treegrid.js',
|
|
|
- 'lib/highcharts/modules/variable-pie.js',
|
|
|
- 'lib/highcharts/modules/variwide.js',
|
|
|
- 'lib/highcharts/modules/vector.js',
|
|
|
- 'lib/highcharts/modules/venn.js',
|
|
|
- 'lib/highcharts/modules/windbarb.js',
|
|
|
- 'lib/highcharts/modules/wordcloud.js',
|
|
|
- 'lib/highcharts/modules/xrange.js',
|
|
|
- 'lib/highcharts/modules/funnel3d.js',
|
|
|
- 'lib/highcharts/modules/heikinashi.js',
|
|
|
- 'lib/highcharts/modules/hollowcandlestick.js',
|
|
|
- 'lib/highcharts/modules/pyramid3d.js',
|
|
|
- 'lib/highcharts/modules/cylinder.js',
|
|
|
-]
|
|
|
register_vue_component('chart', Path(__file__).parent / 'chart.js')
|
|
|
-for path in dependencies:
|
|
|
- register_library(Path(path).stem, Path(__file__).parent / path)
|
|
|
-for path in optional_dependencies:
|
|
|
- register_library(Path(path).stem, Path(__file__).parent / path)
|
|
|
+
|
|
|
+core_dependencies: List[Path] = []
|
|
|
+for path in sorted((Path(__file__).parent / 'lib' / 'highcharts').glob('*.js'), key=lambda p: p.stem):
|
|
|
+ register_library(path.stem, path)
|
|
|
+ core_dependencies.append(path)
|
|
|
+for path in sorted((Path(__file__).parent / 'lib' / 'highcharts' / 'modules').glob('*.js'), key=lambda p: p.stem):
|
|
|
+ register_library(path.stem, path)
|
|
|
|
|
|
|
|
|
class Chart(Element):
|
|
@@ -108,8 +35,8 @@ class Chart(Element):
|
|
|
self._props['options'] = options
|
|
|
self._props['extras'] = extras
|
|
|
self.use_component('chart')
|
|
|
- for dependency in dependencies:
|
|
|
- self.use_library(Path(dependency).stem)
|
|
|
+ for dependency in core_dependencies:
|
|
|
+ self.use_library(dependency.stem)
|
|
|
for extra in extras:
|
|
|
self.use_library(extra)
|
|
|
|