{"id":13825433,"url":"https://github.com/patternfly/patternfly-timeline","last_synced_at":"2025-10-22T20:03:52.900Z","repository":{"id":58231037,"uuid":"66285901","full_name":"patternfly/patternfly-timeline","owner":"patternfly","description":"A time based / event series interactive visualization using d3.js. Use drag and zoom to navigate in time.","archived":true,"fork":false,"pushed_at":"2017-09-29T18:55:00.000Z","size":243,"stargazers_count":142,"open_issues_count":11,"forks_count":39,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-13T07:12:43.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patternfly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-22T15:48:18.000Z","updated_at":"2025-03-29T04:27:40.000Z","dependencies_parsed_at":"2022-08-30T20:01:45.214Z","dependency_job_id":null,"html_url":"https://github.com/patternfly/patternfly-timeline","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly%2Fpatternfly-timeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly%2Fpatternfly-timeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly%2Fpatternfly-timeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly%2Fpatternfly-timeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patternfly","download_url":"https://codeload.github.com/patternfly/patternfly-timeline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253892488,"owners_count":21979994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:01:20.835Z","updated_at":"2025-10-22T20:03:52.561Z","avatar_url":"https://github.com/patternfly.png","language":"JavaScript","readme":"patternfly-timeline\n==========\n\nA time based/event series interactive visualization using d3.js. Use drag and zoom to navigate in time. [View the demo here.](https://rawgit.com/patternfly/patternfly-timeline/master-dist/demo/)\n\nBased on the [EventDrops](https://github.com/marmelab/EventDrops) timeline.\n## Usage\n\nInclude the `src/timeline.js` script in your page after d3:\n\n```html\n\u003cscript src=\"path/to/d3.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"src/timeline.js\"\u003e\u003c/script\u003e\n```\n\n\n\nIn the HTML source, create a new timeline chart, bind data to a DOM element, then call the chart on the element. **Important:** In order for the zoom slider to work correctly, the placeholder element must have `position: relative` or `position: absolute` styling.\n\n```js\nvar timelineChart = d3.chart.timeline();\nd3.select('#chart_placeholder')\n  .datum(data)\n  .call(timelineChart);\n```\n\nThe data must be an array of named time series with an optional details payload. For instance:\n\n```js\nvar json = [\n  {\n    \"name\":\"Power Activity\",\n    \"data\":[\n      {\"date\": \"2016-04-08T15:07:37.374Z\", \"details\": {\"event\": \"vmPowerOn\", \"object\": \"vmName\"}},\n      {\"date\": \"2016-04-08T15:07:37.374Z\", \"details\": {\"event\": \"vmPowerOn\", \"object\": \"vmName\"}},\n      {\"date\": \"2016-04-15T21:04:16.247Z\", \"details\": {\"event\": \"vmPowerOn\", \"object\": \"vmName\"}}\n    ]\n  },\n  {\n    \"name\":\"Alarm/Error\",\n    \"data\":[\n      {\"date\": \"2016-04-21T01:06:19.126Z\", \"details\": {\"event\": \"vmPowerOn\", \"object\": \"vmName\"}},\n      {\"date\": \"2016-04-16T13:07:15.205Z\", \"details\": {\"event\": \"vmPowerOff\", \"object\": \"hostName\"}},\n      {\"date\": \"2016-04-07T22:35:41.145Z\", \"details\": {\"event\": \"vmPowerOff\", \"object\": \"hostName\"}}\n    ]\n  }\n];\n```\n\n## Configuration\n\nPatternfly-timeline follows the [d3.js reusable charts pattern](http://bost.ocks.org/mike/chart/) to let you customize the chart at will:\n\n```js\nvar timelineChart = d3.chart.timeline()\n  .width(1200)\n  .context(false)\n```\n\nConfigurable values:\n\n  - `start`: start date of the scale. Defaults to `new Date(0)`.\n  - `end`: end date of the scale. Defaults to `new Date()`\n  - `minScale`: The minimum scaling (zoom out), default to `0`.\n  - `maxScale`: The maximum scaling (zoom in), default to `Infinity`.\n  - `width`: width of the chart in pixels. Responsive by default.\n  - `padding`: paddings of the graph in pixels. Defaults to `{ top: 30, left: 40, bottom: 40, right: 40 }`\n  - `lineHeight`: The height of each row in the chart, default to `40`.\n  - `contextHeight`: The height of the context viewport below the char, default to `50`.\n  - `locale`: locale used for the X axis labels. See [d3.locale](https://github.com/mbostock/d3/wiki/Localization#locale) for the expected format. Defaults to `null` (i.e. d3 default locale).\n  - `axisFormat`: function receiving the d3 axis object, to customize tick number and size.\n  - `tickFormat`: tickFormat for the X axis. See [d3.timeFormat.multi()](https://github.com/mbostock/d3/wiki/Time-Formatting#format_multi) for expected format.\n  - `eventHover`: function to be called when hovering an event in the chart. Receives the DOM element hovered (uses event delegation).\n  - `eventZoom`: function to be called when done zooming on the chart. Receives the d3 scale at the end of the zoom.\n  - `eventClick`: function to be called on click event of data-point (circle). Receives the DOM element hovered (uses event delegation).\n  - `eventLineColor`: The color of the event line. Accepts a color (color name or `#ffffff` notation), or a function receiving the eventData and returning a color.\n  - `eventColor`: The color of the event. Accepts a color (color name or `#ffffff` notation), or a function receiving the eventData and returning a color. Defaults to null. EventLineColor will be ignored if this is used.\n  - `eventShape`: The shape of the event. Accepts unicode characters, including icon fonts.\n  - `eventPopover`: The contents of the event's popover.\n  - `marker`: `true` by default. Enable current time/date marker under mouse pointer.\n  - `context`: `true` by default. Enable context viewport beneath chart.\n  - `slider`: `true` by default. Enable zoom slider and buttons to right of chart.\n  - `eventGrouping`: `60000`(one minute) by default. The number of milliseconds within which events will be considered to have happened at the same time.\n\n## Styling\n\nYou can style all elements of the chart in CSS. Check the source to see the available selectors.\n\n## Extending / Development\n\nFirst, install the dependencies:\n\n```sh\nnpm install\n```\n\nFor development purpose, you can use the following command:\n\n``` sh\nnpm start\n```\n\nIt serves the demo at http://localhost:8080.\n\nWhen your changes are done, ensure that all tests pass with:\n\n``` sh\nnpm test\n```\n\nFinally, if everything is fine, you can rebuild the library using:\n\n``` sh\nnpm run build\n```\n\n## License\n\nPatternfly Timeline is released under the MIT License\n","funding_links":[],"categories":["JavaScript","Widgets"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternfly%2Fpatternfly-timeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatternfly%2Fpatternfly-timeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternfly%2Fpatternfly-timeline/lists"}