Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from yotamberk/develop
Browse files Browse the repository at this point in the history
Add the examples to the docs
  • Loading branch information
yotamberk authored Apr 5, 2018
2 parents 4c0c5ce + 25f433f commit ba4faa3
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 7 deletions.
86 changes: 82 additions & 4 deletions docs/timeline/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ <h2 id="Overview">Overview</h2>
<h2 id="Contents">Contents</h2>
<ul>
<li><a href="#Overview">Overview</a></li>
<li><a href="#Example">Example</a></li>
<li><a href="#Basic_Example">Basic Example</a></li>
<li><a href="#More_Examples">More Examples</a></li>
<li><a href="#Loading">Loading</a></li>
<li><a href="#Data_Format">Data Format</a>
<ul>
Expand All @@ -83,10 +84,10 @@ <h2 id="Contents">Contents</h2>
<li><a href="#Styles">Styles</a></li>
</ul>

<h2 id="Example">Example</h2>
<h2 id="Basic_Example">Basic Example</h2>
<p>
The following code shows how to create a Timeline and provide it with data.
More examples can be found in the <a href="../../timeline_examples.html">timeline examples</a> page.
More examples can be found in the <a href="#More_Examples">timeline examples</a>.
</p>

<pre class="prettyprint lang-html">&lt;!DOCTYPE HTML&gt;
Expand Down Expand Up @@ -131,6 +132,83 @@ <h2 id="Example">Example</h2>
</pre>


<div class="contentWrapper">
<h1 id='More_Examples'>More Examples</h1>
This page contains examples which show how to use Timeline. <br><br>
<h3>basic usage</h3>
<a class='exampleLink' href="../../examples/basicUsage.html">basic usage</a><br />

<h3>interaction</h3>
<a class='exampleLink' href="../../examples/interaction/animateWindow.html">animate window</a><br />
<a class='exampleLink' href="../../examples/interaction/clickToUse.html">click to use</a><br />
<a class='exampleLink' href="../../examples/interaction/eventListeners.html">event listeners</a><br />
<a class='exampleLink' href="../../examples/interaction/limitMoveAndZoom.html">limit move and zoom of the window</a><br />
<a class='exampleLink' href="../../examples/interaction/navigationMenu.html">navigation menu</a><br />
<a class='exampleLink' href="../../examples/interaction/rollingMode.html">rolling mode</a><br />
<a class='exampleLink' href="../../examples/interaction/setSelection.html">set selection</a><br />

<h3>editing</h3>
<a class='exampleLink' href="../../examples/editing/customSnappingOfItems.html">custom snapping of items</a><br />
<a class='exampleLink' href="../../examples/editing/editingItems.html">editing items</a><br />
<a class='exampleLink' href="../../examples/editing/editingItemsCallbacks.html">editing items, manipulate using callbacks</a><br />
<a class='exampleLink' href="../../examples/editing/individualEditableItems.html">individually editable items</a><br />
<a class='exampleLink' href="../../examples/editing/overrideEditingItems.html">override editable items</a><br />
<a class='exampleLink' href="../../examples/editing/tooltipOnItemChange.html">tooltip on item change</a><br />
<a class='exampleLink' href="../../examples/editing/updateDataOnEvent.html">update data on event</a><br />

<h3>items</h3>
<a class='exampleLink' href="../../examples/items/backgroundAreas.html">background areas</a><br />
<a class='exampleLink' href="../../examples/items/backgroundAreasWithGroups.html">background areas with groups</a><br />
<a class='exampleLink' href="../../examples/items/expectedVsActualTimesItems.html">expected vs actual times items</a><br />
<a class='exampleLink' href="../../examples/items/htmlContents.html">HTML contents</a><br />
<a class='exampleLink' href="../../examples/items/itemOrdering.html">Item ordering</a><br />
<a class='exampleLink' href="../../examples/items/pointItems.html">point items</a><br />
<a class='exampleLink' href="../../examples/items/rangeOverflowItem.html">range overflow</a><br />
<a class='exampleLink' href="../../examples/items/tooltip.html">Tooltips</a><br />
<a class='exampleLink' href="../../examples/items/visibleFrameTemplateContent.html">Dynamic Content</a><br />

<h3>groups</h3>
<a class='exampleLink' href="../../examples/groups/groups.html">groups</a><br />
<a class='exampleLink' href="../../examples/groups/groupsEditable.html">editable groups</a><br />
<a class='exampleLink' href="../../examples/groups/groupsOrdering.html">ordering of groups</a><br />
<a class='exampleLink' href="../../examples/groups/nestedGroups.html">nested groups</a><br />
<a class='exampleLink' href="../../examples/groups/subgroups.html">subgroups</a><br />
<a class='exampleLink' href="../../examples/groups/verticalItemsHide.html">hide vertical items</a><br />

<h3>styling</h3>
<a class='exampleLink' href="../../examples/styling/axisOrientation.html">axis orientation</a><br />
<a class='exampleLink' href="../../examples/styling/customCss.html">custom CSS</a><br />
<a class='exampleLink' href="../../examples/styling/gridStyling.html">grid styling</a><br />
<a class='exampleLink' href="../../examples/styling/itemClassNames.html">item class names</a><br />
<a class='exampleLink' href="../../examples/styling/itemTemplates.html">item templates</a><br />
<a class='exampleLink' href="../../examples/styling/weekStyling.html">week styling</a><br />

<h3>data handling</h3>
<a class='exampleLink' href="../../examples/dataHandling/dataSerialization.html">data serialization</a><br />
<a class='exampleLink' href="../../examples/dataHandling/loadExternalData.html">load external data</a><br />

<h3>other</h3>
<a class='exampleLink' href="../../examples/other/customTimeBars.html">custom time bars</a><br />
<a class='exampleLink' href="../../examples/other/dataAttributes.html">data attributes</a><br />
<a class='exampleLink' href="../../examples/other/dataAttributesAll.html">all data attributes</a><br />

<a class='exampleLink' href="../../examples/other/drag&drop.html">Drag and Drop</a><br />
<a class='exampleLink' href="../../examples/other/functionLabelFormats.html">label formats function</a><br />
<a class='exampleLink' href="../../examples/other/groupsPerformance.html">performance of groups</a><br />
<a class='exampleLink' href="../../examples/other/hidingPeriods.html">hiding periods</a><br />
<a class='exampleLink' href="../../examples/other/horizontalScroll.html">horizontal scroll</a><br />
<a class='exampleLink' href="../../examples/other/localization.html">localization</a><br />
<a class='exampleLink' href="../../examples/other/performance.html">performance</a><br />
<a class='exampleLink' href="../../examples/other/rtl.html">right to left (rtl)</a><br />
<a class='exampleLink' href="../../examples/other/timezone.html">timezone</a><br />
<a class='exampleLink' href="../../examples/other/usingReact.html">React example</a><br />
<a class='exampleLink' href="../../examples/other/verticalScroll.html">vertical scroll</a><br />
<a class='exampleLink' href="../../examples/other/requirejs/requirejs_example.html">require.js example</a><br />
</div>




<h2 id="Loading">Loading</h2>
<p>
Install or download the <a href="http://visjs.org" target="_blank">timeline.js</a> library
Expand Down Expand Up @@ -1900,7 +1978,7 @@ <h2 id="Editing_Items">Editing Items</h2>
};
</pre>

A full example is available here: <a href="../../examples/timeline/editing/editingItemsCallbacks.html">editingItemsCallbacks.html</a>.
A full example is available here: <a href="../../examples/editing/editingItemsCallbacks.html">editingItemsCallbacks.html</a>.


<h2 id="Templates">Templates</h2>
Expand Down
6 changes: 3 additions & 3 deletions lib/timeline/component/LineGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ LineGraph.prototype._onAdd = function (ids) {
this._onUpdate(ids);
};
LineGraph.prototype._onRemove = function (ids) {
this._onUpdate(ids);
this._updateAllGroupData(ids, undefined, true);
};
LineGraph.prototype._onUpdateGroups = function (groupIds) {
this._updateAllGroupData(null, groupIds);
Expand Down Expand Up @@ -429,7 +429,7 @@ LineGraph.prototype._updateGroup = function (group, groupId) {
* @param {Array} groupIds
* @private
*/
LineGraph.prototype._updateAllGroupData = function (ids, groupIds) {
LineGraph.prototype._updateAllGroupData = function (ids, groupIds, removedItems = false) {
if (this.itemsData != null) {
var groupsContent = {};
var items = this.itemsData.get();
Expand All @@ -454,7 +454,7 @@ LineGraph.prototype._updateAllGroupData = function (ids, groupIds) {

//Pre-load arrays from existing groups if items are not changed (not in ids)
var existingItemsMap = {};
if (!groupIds && ids) {
if (!groupIds && ids && removedItems !== true) {
for (groupId in this.groups) {
if (this.groups.hasOwnProperty(groupId)) {
group = this.groups[groupId];
Expand Down

0 comments on commit ba4faa3

Please sign in to comment.