-
Notifications
You must be signed in to change notification settings - Fork 97
Editors
The main chart editor object
var editor = highed.Editor("my-div", {});
-
parent - domnode
: the node to attach the editor to -
attributes - object
: the editor settings-
defaultChartOptions (object)
- the initial chart options -
on (object)
- event listeners: key is event name, value is a function -
plugins (string|array)
- the editor plugins to enable -
features (string)
- the features to enable:import
,export
,templates
,customize
,welcome
. Separate by string. -
includeSVGInHTMLEmbedding (bool)
- if true (which is default) the exported HTML will contain both an SVG fallback and the JavaScript injection -
importer (object)
- options passed to the contained importer object (see highed.DataImporter) -
exporter (object)
- options passd to the contained export object (see highed.DataExporter) -
availableSettings (array)
- array containing a whitelist of editable properties. Default is "show all available"
-
-
on(event, callback)
: Listen for event - returnsfunction
: Can be called to unbind the listener-
event
:string
, The event to listen for -
callback
:function
, Function to call when the event is emitted
-
-
resize()
:
-
ChartChange
: when the chart changes-
{object} (object)
- new chart data
-
-
ChartChangedLately
: when the chart changes, on a throttle so events are not emitted more frequently than every 100ms-
{object} (object)
- new chart data
-
highed.Editor
- A new instance of an editor
./src/editors/highed.editor.js:156
:
highed.Editor = function (parent, attributes) {
Simple one-pane editor
An essentials-only editor.
var simpleEditor = highed.SimpleEditor(document.body, {
availableSettings: [ "title--text", "subtitle--text" ]
});
simpleEditor.on("Change", function(chart) {
console.log(chart.export.html());
});
-
parent - domnode
: the node to attach to -
attributes - object
: the options for the editor-
importer (object)
- options passed to the importer widget-
options (string|array<string>)
- the options to include -
plugins (string|array<sting>)
- the plugins to enable -
availableSettings (array<string>)
- the settings to include -
chart (object)
- default chart settings
-
-
-
on(event, callback)
: Listen for event - returnsfunction
: Can be called to unbind the listener-
event
:string
, The event to listen for -
callback
:function
, Function to call when the event is emitted
-
-
resize()
: Force a resize of the editor
-
change
: when the chart changes-
{highed.ChartPreview} (highed.ChartPreview)
- an instance of the chart preview
-
-
toolbar - domnode
: Main toolbar -
chart - highed.ChartPreview
: The chart preview
./src/editors/highed.simple.editor.js:55
:
highed.SimpleEditor = function (parent, attributes) {
A modal editor
The modal editor connects to a "summoner", which is the DOM node that should
spawn the editor. This arg is however optional, and if not present,
show()
should be called instead when wanting to display it.
The contained editor can either be a full editor, or a simple editor.
highed.ModalEditor("icon", {
allowDone: true
}, function(html) {
doSomethingWithTheExportedHTML(html);
});
-
summoner - domnode
: the node which spawns the editor -
attributes - object
: properties. Note that this object is also passed to the editor constructor.-
type (string)
- eitherfull
orsimple
. -
allowDone (bool)
- if set to true (default is false) a "Close and use" button will appear on the top bar
-
-
fn - function
: function to call when done editing, argument is embeddable HTML
-
attachToSummoner(nn)
: Attach to a new summoner-
nn
:domnode
, the new node to attach to
-
./src/editors/highed.modaleditor.js:52
:
highed.ModalEditor = function (summoner, attributes, fn) {
Install an editor plugin
Note that plugins must be enabled when creating the editor for it to be active.
-
name - string
: the name of the plugin -
definition - object
: the plugin definition-
meta (object)
--
version (string)
- -
author (string)
- -
homepage (string)
- -
dependencies (array<string>)
- URLs of script dependencies -
options (object)
--
<option_name> (object)
--
type (string)
- the type of the option -
label (string)
- the label -
default (anything)
- the default value
-
-
-
-
./src/editors/highed.editor.js:60
:
function install(name, definition) {
Overview
Stand-alone Usage
Advanced
- Enable Advanced Customization
- Choosing Which Options to Include
- Adding Custom Templates
- Plugins
- Disabling Editor Features
- Adding Fonts
- Custom Templates
- Localization
- Sticky Chart Options
Integrating
API Reference