Open
Conversation
mojoaxel
reviewed
Dec 3, 2025
| src="https://unpkg.com/vis-timeline@latest/standalone/umd/vis-timeline-graph2d.min.js" | ||
| ></script> | ||
| ``` | ||
| ```` |
mojoaxel
requested changes
Dec 3, 2025
Comment on lines
+96
to
+106
| ## Options | ||
|
|
||
| | Property | Type | Default | Description | Examples and Demos | | ||
| | ----------- | ---------------------------------------------------------------------------------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | **STYLING** | | | | | ||
| | rtl | _boolean_ | false | Right-to-left option for rtl languages, e.g. Arabic. | | ||
| | orientation | _{axis:<br>"both"\|"bottom" \| "none" \| "top",<br>item: "top" \| "bottom"}_ | {axis:"bottom", item: "bottom"} | There are a number of orientation options for the time axis and the items. | [Example](https://github.com/visjs/vis-timeline/blob/master/examples/timeline/styling/axisOrientation.html) \| [Demo](https://visjs.github.io/vis-timeline/examples/timeline/styling/axisOrientation.html) | | ||
| | **EDITING** | | | | | ||
| | editable | _boolean \| {add: boolean, updateTime: boolean, updateGroup: boolean, remove: boolean }_ | false | An editable timeline allows to drag items around, create new items, and remove items. Changes are logged in the browser console. | | | ||
| | multiselect | _boolean_ | false | **Editable** option is required.<br><br>Allow selecting multiple items using ctrl+click, shift+click, or hold. | | ||
| | snap | _function(date: Date, scale: string, step: number) \| null_ | null | **Editable** option is required.<br><br>Snap function controls timeline item alignment:<br>- Returns modified Date object<br>- Called when items are moved<br>- Affects time unit snapping<br>- Set to _null_ to disable snapping | See [Snap Example](#snap-example) for implementation | |
Member
There was a problem hiding this comment.
The options are already described in the docs and should not be part of the readme. Otherwise we have two places we need to maintain them.
Comment on lines
+108
to
+145
| ## Selectors | ||
|
|
||
| ### Custom CSS | ||
|
|
||
| [Demo](https://visjs.github.io/vis-timeline/examples/timeline/styling/customCss.html) \| [Example](https://github.com/visjs/vis-timeline/blob/master/examples/timeline/styling/customCss.html) | ||
|
|
||
| The style of the Timeline can be fully customized via CSS. | ||
|
|
||
|  | ||
|
|
||
| Below are some of the selectors to customize the timeline. | ||
|
|
||
| ```css | ||
| .vis-timeline { | ||
| } | ||
| .vis-item { | ||
| } | ||
|
|
||
| .vis-item.vis-line { | ||
| } | ||
| .vis-item.vis-dot { | ||
| } | ||
|
|
||
| .vis-item.vis-selected { | ||
| } | ||
|
|
||
| .vis-time-axis .vis-text { | ||
| } | ||
| .vis-time-axis .vis-text.vis-major { | ||
| } | ||
| .vis-time-axis .vis-text.vis-minor { | ||
| } | ||
|
|
||
| .vis-time-axis .vis-grid.vis-minor { | ||
| } | ||
| .vis-time-axis .vis-grid.vis-major { | ||
| } | ||
| ``` |
Member
There was a problem hiding this comment.
These selectors are already described here: https://visjs.github.io/vis-timeline/docs/timeline/#Styles
Feel free to extend the docs if necessary!
Comment on lines
+146
to
+158
|
|
||
| You can use html snippets to embed images within items. Check content in the example below: | ||
|
|
||
| ```javascript | ||
| var items = new vis.DataSet([ | ||
| /* Other items */ | ||
| { | ||
| start: new Date(2010, 7, 23, 23, 0, 0), | ||
| content: | ||
| '<div>Mail from boss</div><img src="../resources/img/mail-icon.png" style="width:32px; height:32px;">', | ||
| }, | ||
| ]); | ||
| ``` |
Member
There was a problem hiding this comment.
pleas extend the existing docs if neccessary: https://visjs.github.io/vis-timeline/docs/timeline/#Templates
Member
There was a problem hiding this comment.
Maybe we could add this image to the docs, but not here in the root folder!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added clarifications and details to the documentation that reveal how to use the examples and summarizes the properties and selectors.