ECharts.Assets (echarts v0.1.1)

Copy Markdown View Source

The JavaScript bundles shipped with ECharts.

Assets live in priv/static and are served by ECharts.Phoenix.Plug (for Phoenix applications) or imported by the Livebook kino. The Apache ECharts bundle is vendored so charts work offline and do not depend on a CDN.

Only the files returned by files/0 are servable. Use path/1 when you need to read a file yourself — for example to copy the bundles into a custom static directory.

Summary

Functions

Returns true when name is a servable asset.

Returns the absolute path of the bundled assets directory.

Returns the vendored Apache ECharts GL version.

Returns the vendored Apache ECharts version.

Returns the names of every servable asset.

Returns the content type for a bundled asset.

Returns the absolute path of a servable asset.

Returns the file name of a plugin bundle.

Returns the supported plugin names.

Functions

asset?(name)

@spec asset?(term()) :: boolean()

Returns true when name is a servable asset.

dir()

@spec dir() :: String.t()

Returns the absolute path of the bundled assets directory.

echarts_gl_version()

@spec echarts_gl_version() :: String.t()

Returns the vendored Apache ECharts GL version.

echarts_version()

@spec echarts_version() :: String.t()

Returns the vendored Apache ECharts version.

files()

@spec files() :: [String.t()]

Returns the names of every servable asset.

mime_type(name)

@spec mime_type(String.t()) :: String.t()

Returns the content type for a bundled asset.

path(name)

@spec path(String.t()) :: String.t()

Returns the absolute path of a servable asset.

Raises ArgumentError for unknown names, which keeps path traversal out of the plug.

plugin_file(plugin)

@spec plugin_file(String.t() | atom()) :: String.t()

Returns the file name of a plugin bundle.

Raises ArgumentError for unknown plugins.

plugins()

@spec plugins() :: [String.t()]

Returns the supported plugin names.