From 944511f4c78b988f5ee7702040acad019b6f23ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Martins?= start
,
end
(optional), content
,
- group
(optional), className
(optional),
+ group
(optional), className
(optional),
editable
(optional), and style
(optional).
order
properties are provided, the order will be undetermined.
-
+
selectable
is true
.
selectable
and editable.add
are set true
.
selectable
and editable.updateTime
or editable.updateGroup
are set true
.
selectable
and editable.remove
are set true
.
content
. See section Templates for a detailed explanation.0
tooltip
. In this case the function is called
with an object containing parameters x
,
- y
, and z
argument,
+ y
, z
, and data
+ (the source JS object for the point) as an argument,
and must return a string which may contain HTML.
format
is:
@@ -583,8 +583,16 @@ function (option, path) {
year: ''
}
}
+
For values which not provided in the customized options.format
, the default values will be used.
All available formatting syntax is described in the docs of moment.js.
+ function format({ + minorLabels: Function(date: Date, scale: Number, step: Number), + majorLabels: Function(date: Date, scale: Number, step: Number) +}
+ This example demonstrate using custom function label formats. +
+ + + + + \ No newline at end of file diff --git a/lib/timeline/TimeStep.js b/lib/timeline/TimeStep.js index c5a9bfc2..dc3991ed 100644 --- a/lib/timeline/TimeStep.js +++ b/lib/timeline/TimeStep.js @@ -532,6 +532,10 @@ TimeStep.prototype.getLabelMinor = function(date) { date = this.current; } + if (typeof(this.format.minorLabels) === "function") { + return this.format.minorLabels(date, this.scale, this.step); + } + var format = this.format.minorLabels[this.scale]; return (format && format.length > 0) ? this.moment(date).format(format) : ''; }; @@ -546,6 +550,10 @@ TimeStep.prototype.getLabelMajor = function(date) { if (date == undefined) { date = this.current; } + + if (typeof(this.format.majorLabels) === "function") { + return this.format.majorLabels(date, this.scale, this.step); + } var format = this.format.majorLabels[this.scale]; return (format && format.length > 0) ? this.moment(date).format(format) : ''; diff --git a/lib/timeline/component/Group.js b/lib/timeline/component/Group.js index 512fac58..3d0d0e82 100644 --- a/lib/timeline/component/Group.js +++ b/lib/timeline/component/Group.js @@ -180,6 +180,7 @@ Group.prototype.redraw = function(range, margin, restack) { // recalculate the height of the subgroups this._calculateSubGroupHeights(); + this.isVisible = this._isGroupVisible(range, margin); // reposition visible items vertically @@ -220,7 +221,7 @@ Group.prototype.redraw = function(range, margin, restack) { stack.nostack(this.visibleItems, margin, this.subgroups); } } - + if (!this.isVisible && this.height) { return resized = false; } @@ -275,7 +276,6 @@ Group.prototype._calculateSubGroupHeights = function () { * check if group is visible * @private */ - Group.prototype._isGroupVisible = function (range, margin) { var isVisible = (this.top <= range.body.domProps.centerContainer.height - range.body.domProps.scrollTop + margin.axis) diff --git a/lib/timeline/optionsTimeline.js b/lib/timeline/optionsTimeline.js index fc4330fe..a20d27f4 100644 --- a/lib/timeline/optionsTimeline.js +++ b/lib/timeline/optionsTimeline.js @@ -47,7 +47,7 @@ let allOptions = { day: {string,'undefined': 'undefined'}, month: {string,'undefined': 'undefined'}, year: {string,'undefined': 'undefined'}, - __type__: {object} + __type__: {object, 'function': 'function'} }, majorLabels: { millisecond: {string,'undefined': 'undefined'}, @@ -58,7 +58,7 @@ let allOptions = { day: {string,'undefined': 'undefined'}, month: {string,'undefined': 'undefined'}, year: {string,'undefined': 'undefined'}, - __type__: {object} + __type__: {object, 'function': 'function'} }, __type__: {object} }, From ea859d4c79fed82a426affa2dcc7cf95821e1614 Mon Sep 17 00:00:00 2001 From: Andrew Speed+ In this example, the network data can be exported to JSON and imported back into the network. + + Try this out by exporting the network to JSON, clearing the network and then importing it again. The nodes will all appear in the same position as they were before the network was destroyed. +
+ + + +content
. See section Templates for a detailed explanation.content
. See section Templates for a detailed explanation.content
. See section Templates for a detailed explanation.content
. See section Templates for a detailed explanation.+ template: function (item, element) { + return ReactDOM.render(<b>{item.content}</b>, element); + }, ++ +
+ There two type of liner endings. The classical "arrow" (default) and "circle". +
+ + + + + + + + From 37c595e906b5e4a85b850de0be48312ff72b17f6 Mon Sep 17 00:00:00 2001 From: Alexander Wunschik1
arrow
arrow
. Also possible is circle
.allowSingleNodeCluster : true
property.
++ clusterNodeProperties: { + allowSingleNodeCluster: true + } +
+ Clusters can contain other clusters, but clusters of a single node is only possible by adding +
allowSingleNodeCluster: true+to clusterNodeProperties
en_US
it
it_IT
it_CH
+ 'en'
, 'de'
, 'es'
and 'nl'
are supported. Take a look
+ 'en'
, 'de'
, 'es'
, 'it'
and 'nl'
are supported. Take a look
at
the locales
diff --git a/lib/network/locales.js b/lib/network/locales.js
index ad5a523a..e71a971f 100644
--- a/lib/network/locales.js
+++ b/lib/network/locales.js
@@ -53,6 +53,24 @@ exports['es'] = {
};
exports['es_ES'] = exports['es'];
+//Italiano
+exports['it'] = {
+ edit: 'Modifica',
+ del: 'Cancella la selezione',
+ back: 'Indietro',
+ addNode: 'Aggiungi un nodo',
+ addEdge: 'Aggiungi un vertice',
+ editNode: 'Modifica il nodo',
+ editEdge: 'Modifica il vertice',
+ addDescription: 'Clicca per aggiungere un nuovo nodo',
+ edgeDescription: 'Clicca su un nodo e trascinalo ad un altro nodo per connetterli.',
+ editEdgeDescription: 'Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.',
+ createEdgeError: 'Non si possono collegare vertici ad un cluster',
+ deleteClusterError: 'I cluster non possono essere cancellati',
+ editClusterError: 'I clusters non possono essere modificati.'
+};
+exports['it_IT'] = exports['it'];
+
// Dutch
exports['nl'] = {
edit: 'Wijzigen',
From f61c83ac6e8eaaf833fcccd7a05dc21fece1eb0a Mon Sep 17 00:00:00 2001
From: Alexander Wunschik 'en'
'en'
, 'de'
, 'es'
, 'it'
and 'nl'
are supported. Take a look
- at
- the locales
- section below for more explaination on how to customize this.
+ 'en'
,
+ 'de'
,
+ 'es'
,
+ 'it'
,
+ 'nl'
+ 'pt-br'
,
+ 'ru'
+ are supported. Take a look at the
+ locales section below
+ for more explaination on how to customize this.
Object selection
,
+ Object selection
,
[Object options]
)