Options
All
  • Public
  • Public/Protected
  • All
Menu

Library @swim/chart

@swim/chart

package documentation chat

@swim/chart provides multi-plot, fully animatable, canvas rendered chart widgets, supporting line, area, and bubble graphs, with customizable axes, and kinematic multitouch scale gestures for panning and zooming with momentum. Check out the bubble chart, area chart, line chart, and chart axes demos to see multi-touch charts in action. @swim/chart is part of the @swim/vis framework.

Installation

npm

For an npm-managed project, npm install @swim/chart to make it a dependency. TypeScript sources will be installed into node_modules/@swim/chart/main. Transpiled JavaScript and TypeScript definition files install into node_modules/@swim/chart/lib/main. And a pre-built UMD script can be found in node_modules/@swim/chart/dist/main/swim-chart.js.

Browser

Browser applications can load swim-vis.js—which bundles the @swim/chart library—along with its swim-core.js, swim-mesh.js, and swim-ui.js dependencies, directly from the SwimOS CDN.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-core.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-mesh.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-vis.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-mesh.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-vis.min.js"></script>

Alternatively, the swim-toolkit.js script may be loaded, along with its swim-system.js dependency, from the SwimOS CDN. The swim-toolkit.js script bundles @swim/chart together with all other @swim/toolkit frameworks.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-system.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-toolkit.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-toolkit.min.js"></script>

Usage

ES6/TypeScript

@swim/chart can be imported as an ES6 module from TypeScript and other ES6-compatible environments.

import * as chart from "@swim/chart";

CommonJS/Node.js

@swim/chart can also be used as a CommonJS module in Node.js applications.

var chart = require("@swim/chart");

Browser

When loaded by a web browser, the swim-chart.js script adds all @swim/chart library exports to the global swim namespace. The swim-chart.js script requires that swim-core.js, swim-mesh.js, and swim-ui.js have already been loaded.

The swim-toolkit.js script also adds all @swim/chart library exports to the global swim namespace, making it a drop-in replacement for swim-ui.js and swim-chart.js when additional @swim/toolkit frameworks are needed.

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Type aliases

AnyAreaPlotView

AnyAreaPlotView<X, Y>: AreaPlotView<X, Y> | AreaPlotViewInit<X, Y>

Type parameters

  • X

  • Y

AnyAxisView

AnyAxisView<D>: AxisView<D> | AxisViewInit<D>

Type parameters

  • D

AnyBubblePlotView

AnyBubblePlotView<X, Y>: BubblePlotView<X, Y> | BubblePlotViewInit<X, Y>

Type parameters

  • X

  • Y

AnyChartView

AnyChartView<X, Y>: ChartView<X, Y> | ChartViewInit<X, Y>

Type parameters

  • X

  • Y

AnyDataPointView

AnyDataPointView<X, Y>: DataPointView<X, Y> | DataPointViewInit<X, Y>

Type parameters

  • X

  • Y

AnyGraphView

AnyGraphView<X, Y>: GraphView<X, Y> | GraphViewInit<X, Y>

Type parameters

  • X

  • Y

AnyLinePlotView

AnyLinePlotView<X, Y>: LinePlotView<X, Y> | LinePlotViewInit<X, Y>

Type parameters

  • X

  • Y

AnyPlotView

AnyPlotView<X, Y>: PlotView<X, Y> | PlotViewInit<X, Y> | PlotType

Type parameters

  • X

  • Y

AnyScatterPlotView

AnyScatterPlotView<X, Y>: ScatterPlotView<X, Y> | ScatterPlotViewInit<X, Y> | ScatterPlotType

Type parameters

  • X

  • Y

AnySeriesPlotView

AnySeriesPlotView<X, Y>: SeriesPlotView<X, Y> | SeriesPlotViewInit<X, Y> | SeriesPlotType

Type parameters

  • X

  • Y

AnyTickView

AnyTickView<D>: TickView<D> | TickViewInit<D>

Type parameters

  • D

AxisOrientation

AxisOrientation: "top" | "right" | "bottom" | "left"

DataPointCategory

DataPointCategory: "flat" | "increasing" | "decreasing" | "maxima" | "minima"

DataPointLabel

DataPointLabel<X, Y>: DataPointLabelFunction<X, Y> | string

Type parameters

  • X

  • Y

DataPointLabelFunction

DataPointLabelFunction<X, Y>: (dataPointTrait: DataPointTrait<X, Y>) => GraphicsView | string | null

Type parameters

  • X

  • Y

Type declaration

DataPointLabelPlacement

DataPointLabelPlacement: "auto" | "above" | "middle" | "below"

PlotType

PlotType: "bubble" | "line" | "area"

ScaledFlags

ScaledFlags: number

ScatterPlotType

ScatterPlotType: "bubble"

SeriesPlotHitMode

SeriesPlotHitMode: "domain" | "plot" | "data" | "none"

SeriesPlotType

SeriesPlotType: "line" | "area"

TickOrientation

TickOrientation: "top" | "right" | "bottom" | "left"

Variables

PlotView

PlotView: { fromAny: any; fromInit: any; fromType: any; is: any }

Type declaration

  • fromAny: function
    • Type parameters

      • X_3

      • Y_3

      Parameters

      Returns PlotView<X_3, Y_3>

  • fromInit: function
    • Type parameters

      • X_2

      • Y_2

      Parameters

      Returns PlotView<X_2, Y_2>

  • fromType: function
    • Type parameters

      • X_1

      • Y_1

      Parameters

      Returns PlotView<X_1, Y_1>

  • is: function
    • is<X, Y>(object: unknown): object is PlotView<X, Y>
    • Type parameters

      • X

      • Y

      Parameters

      • object: unknown

      Returns object is PlotView<X, Y>

ScaledXView

ScaledXView: { is: any }

Type declaration

  • is: function
    • Type parameters

      • X

      Parameters

      • object: unknown

      Returns object is ScaledXView<X>

ScaledXYView

ScaledXYView: { is: any }

Type declaration

  • is: function
    • Type parameters

      • X

      • Y

      Parameters

      • object: unknown

      Returns object is ScaledXYView<X, Y>

ScaledYView

ScaledYView: { is: any }

Type declaration

  • is: function
    • Type parameters

      • Y

      Parameters

      • object: unknown

      Returns object is ScaledYView<Y>

Generated using TypeDoc