diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..bb81dda8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +## Contributing + +Contributions to the vis.js library are very welcome! We can't do this alone. +You can contribute in different ways: spread the word, report bugs, come up with +ideas and suggestions, and contribute to the code. + +There are a few preferences regarding code contributions: + +- vis.js follows the node.js code style as described + [here](http://nodeguide.com/style.html). +- When implementing new features, please update the documentation accordingly. +- Send pull requests to the `develop` branch, not the `master` branch. +- Only commit changes done in the source files under `lib`, not to the builds + which are located in the folder `dist`. + +Thanks! diff --git a/HISTORY.md b/HISTORY.md index 3d99c305..f000c549 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -27,29 +27,82 @@ http://visjs.org - Rebuilt the cluster system +## not yet released, version 3.12.1-SNAPSHOT -## not yet released, version 3.10.1-SNAPSHOT +### Timeline + +- Fixed #761: Timeline and Graph2d throwing an error when locale is not found. + Gives a warning message instead. +- Fixed #782: Contents of items created from a template being unnecessary + recreated on click, causing mouse events to get lost. + +### Network + +- Fixed titles not working when any of the nodes has id `0`. + + +## 2015-04-07, version 3.12.0 + +### Network + +- Fixed support for DataSet with custom id fields (option `fieldId`). + +### Timeline + +- Orientation can now be configured separately for axis and items. +- The event handlers `onMove` and `onMoving` are now invoked with all item + properties as argument, and can be used to update all properties (like + content, className, etc) and add new properties as well. +- Fixed #654: removed unnecessary minimum height for groups, takes the + height of the group label as minimum height now. +- Fixed #708: detecting wrong group when page is scrolled. +- Fixed #733: background items being selected on shift+click. + + +## 2015-03-05, version 3.11.0 ### Network - (added gradient coloring for lines, but set for release in 4.0 due to required refactoring of options) - Fixed bug where a network that has frozen physics would resume redrawing after setData, setOptions etc. -- (add docs) Added option to bypass default groups. If more groups are specified in the nodes than there are in the groups, loop over supplied groups instead of default. -- (add docs) Added two new static smooth curves modes: curveCW and curve CCW. -- Added request redraw for certain internal processes to reduce number of draw calls. +- Added option to bypass default groups. If more groups are specified in the nodes than there are in the groups, loop over supplied groups instead of default. +- Added two new static smooth curves modes: curveCW and curve CCW. +- Added request redraw for certain internal processes to reduce number of draw calls (performance improvements!). - Added pull request for usage of Icons. Thanks @Dude9177! - Allow hierarchical view to be set in setOptions. - Fixed manipulation bar for mobile. - -### Graph2d - - +- Fixed #670: Bug when updating data in a DataSet, when Network is connected to the DataSet via a DataView. +- Fixed #688: Added a css class to be able to distinguish buttons "Edit node" + and "Edit edge". ### Timeline +- Implemented orientation option `'both'`, displaying a time axis both on top + and bottom (#665). +- Implemented creating new range items by dragging in an empty space with the + ctrl key down. +- Implemented configuration option `order: function` to define a custom ordering + for the items (see #538, #234). +- Implemented events `click`, `doubleClick`, and `contextMenu`. +- Implemented method `getEventProperties(event)`. - Fixed not property initializing with a DataView for groups. - Merged add custom timebar functionality, thanks @aytech! - Fixed #664: end of item not restored when canceling a move event. +- Fixed #609: reduce the left/right dragarea when an item range is very small, + so you can still move it as a whole. +- Fixed #676: misalignment of background items when using subgroups and the + group label's height is larger than the contents. + +### Graph2d + +- Implemented events `click`, `doubleClick`, and `contextMenu`. +- Implemented method `getEventProperties(event)`. + +### DataSet/DataView + +- Implemented support for mapping field names. Thanks @spatialillusions. +- Fixed #670: DataView not passing a data property on update events (see #670) + ## 2015-02-11, version 3.10.0 @@ -91,11 +144,6 @@ http://visjs.org - Fixed a bug in the `DataSet` returning an empty object instead of `null` when no item was found when using both a filter and specifying fields. -### Timeline - -- Implemented option `timeAxis: {scale: string, step: number}` to set a - fixed scale. - ## 2015-01-16, version 3.9.1 diff --git a/dist/vis.css b/dist/vis.css index b00cb06b..c05381a2 100644 --- a/dist/vis.css +++ b/dist/vis.css @@ -262,6 +262,7 @@ .vis-item.vis-range .vis-drag-left { position: absolute; width: 24px; + max-width: 20%; height: 100%; top: 0; left: -4px; @@ -272,6 +273,7 @@ .vis-item.vis-range .vis-drag-right { position: absolute; width: 24px; + max-width: 20%; height: 100%; top: 0; right: -4px; @@ -1221,4 +1223,4 @@ div.vis-color-picker input.vis-range-brightness { div.vis-color-picker input.vis-saturation-range { width: 289px !important; -}*/ \ No newline at end of file +}*/ diff --git a/docs/dataset.html b/docs/dataset.html index add1bc04..81152644 100644 --- a/docs/dataset.html +++ b/docs/dataset.html @@ -740,9 +740,10 @@ DataSet.map(callback [, options]);
fields
is defined, only the properties
whose name is specified in fields
will be included
diff --git a/docs/dataview.html b/docs/dataview.html
index 93b13042..28e3ec6c 100644
--- a/docs/dataview.html
+++ b/docs/dataview.html
@@ -129,9 +129,10 @@ var data = new vis.DataView(dataset, options)
fields
is defined, only the properties
whose name is specified in fields
will be included
diff --git a/docs/graph2d.html b/docs/graph2d.html
index aa3dce7b..d82db4eb 100644
--- a/docs/graph2d.html
+++ b/docs/graph2d.html
@@ -678,7 +678,7 @@ The options colored in green can also be used as options for the groups. All opt
Graph2d.getEventProperties(event)
.
+ graph2d.on('contextmenu', function (props) { + alert('Right click!'); + props.event.preventDefault(); +}); ++
Graph2d.getEventProperties(event)
.
+ Graph2d.getEventProperties(event)
.
+ pageX
(Number): absolute horizontal position of the click event.pageY
(Number): absolute vertical position of the click event.x
(Number): relative horizontal position of the click event.y
(Number): relative vertical position of the click event.time
(Date): Date of the clicked event.value
(Number[]): The data value of the click event. The array contains one value when there is one data axis visible, and two values when there are two visible data axes.what
(String | null): name of the clicked thing: background
, axis
, dat-axis
, custom-time
, or current-time
, legend
.event
(Object): the original click event.{start: '2014-03-21 00:00:00', end: '2014-03-28 00:00:00', [repeat:'daily']}
or as an Array of these objects. The repeat argument is optional.
+ The possible values are (case-sensitive): daily, weekly, monthly, yearly
. To hide a weekend, pick any Saturday as start and the following Monday as end
+ and set repeat to weekly.
edges
, which both contain an array with objects.
Optionally, data may contain an options
object.
The parameter data
is optional, data can also be set using
- the method setData
. Section Data Format
+ the method setData
. Section Data Format
describes the data object.
options
is an optional Object containing a name-value map
with options. Options can also be set using the method
setOptions
.
- Section Configuration Options
+ Section Configuration Options
describes the available options.
options
,
containing an object with global options.
Options can be provided as third parameter in the network constructor
- as well. Section Configuration Options
+ as well. Section Configuration Options
describes the available options.
@@ -280,13 +280,13 @@ When using a DataSet, the network is automatically updating to changes in the Da
clickToUse
, it will react to mouse, touch, and keyboard events only when active.
When active, a blue shadow border is displayed around the Network. The Network is set active by clicking on it, and is changed to inactive again by clicking outside the Network or by pressing the ESC key.continuous, discrete, diagonalCross, straightCross, horizontal, vertical
. The effects of these types
+ continuous, discrete, diagonalCross, straightCross, horizontal, vertical, curvedCW, curvedCCW
. The effects of these types
are shown in examples 26 and 27Note: if the behaviour of your network is not the way you want it, use configurePhysics as described below or by example 25.
+Note: if the behaviour of your network is not the way you want it, use configurePhysics as described below or by example 25.
// These variables must be defined in an options object named physics. @@ -2648,6 +2655,13 @@ network.off('select', onSelect); none
null
.
If end date is provided, the item is displayed as a range.
@@ -232,7 +232,7 @@ var items = [
new Date(2010,9,23)
.margin.axis
, margin.item.horizontal
, and margin.item.vertical
.group
(Number | null): the id of the clicked group.item
(Number | null): the id of the clicked item.pageX
(Number): absolute horizontal position of the click event.pageY
(Number): absolute vertical position of the click event.x
(Number): relative horizontal position of the click event.y
(Number): relative vertical position of the click event.time
(Date): Date of the clicked event.snappedTime
(Date): Date of the clicked event, snapped to a nice value.what
(String | null): name of the clicked thing: item
, background
, axis
, group-label
, custom-time
, or current-time
.event
(Object): the original click event.Timeline.getEventProperties(event)
.
+ timeline.on('contextmenu', function (props) { + alert('Right click!'); + props.event.preventDefault(); +}); ++
Timeline.getEventProperties(event)
.
+ Timeline.getEventProperties(event)
.
+
- When the Timeline is configured to be editable (both options selectable
and editable
are true
), the user can move items by dragging them, can create a new item by double tapping on an empty space, can update an item by double tapping it, and can delete a selected item by clicking the delete button on the top right.
+ When the Timeline is configured to be editable (both options selectable
and editable
are true
), the user can:
Option editable
accepts a boolean or an object. When editable
is a boolean, all manipulation actions will be either enabled or disabled. When editable
is an object, one can enable individual manipulation actions:
+ By default, the items displayed on the Timeline are unordered. They are + stacked in the order that they where loaded. This means that way items are + stacked can change while moving and zooming the Timeline. +
+
+ To display and stack the items in a controlled order, you can provide a
+ custom sorting function via the configuration option order
.
+
+ WARNING: Custom ordering is only suitable for small amounts of items (up to a few + hundred), as the Timeline has to render all items once on load to + determine their width and height. +
++ +
+ + + + +diff --git a/examples/timeline/08_edit_items.html b/examples/timeline/08_edit_items.html index 2a79ef0e..2ffbb91f 100644 --- a/examples/timeline/08_edit_items.html +++ b/examples/timeline/08_edit_items.html @@ -64,6 +64,7 @@ onMoving: function (item, callback) { if (item.start < min) item.start = min; if (item.start > max) item.start = max; + if (item.end > max) item.end = max; callback(item); // send back the (possibly) changed item }, diff --git a/examples/timeline/35_item_ordering.html b/examples/timeline/35_item_ordering.html new file mode 100644 index 00000000..a1b560b6 --- /dev/null +++ b/examples/timeline/35_item_ordering.html @@ -0,0 +1,80 @@ + + +
+
+ + + + + + +
+