0.2.2 • Published 7 years ago

@redsift/d3-rs-schedule v0.2.2

Weekly downloads
16
License
MIT
Repository
github
Last release
7 years ago

d3-rs-schedule

Circle CI npm MIT

d3-rs-schedule generate a schedule / calander like presentation via the D3 reusable chart convention.

Example

View @redsift/d3-rs-schedule on Codepen

Empty

Empty

Single Entry

Single Entry

Usage

Browser

<script src="//static.redsift.io/reusable/d3-rs-schedule/latest/d3-rs-schedule.umd-es2015.min.js"></script>
<script>
	var chart = d3_rs_schedule.html();
	d3.select('body').datum([ { s: 1469723575941, e: 1469726870991, t: "Text to display", u: "proposed" } ]).call(chart);
</script>

ES6

import { chart } from "@redsift/d3-rs-schedule";
let eml = chart.html();
...

Require

var chart = require("@redsift/d3-rs-schedule");
var eml = chart.html();
...

Datum

{ s: 1469723575941, e: 1469726870991, t: "Text to display", u: "proposed" } ...

s start timestamp for the event (epoch UTC ms) e start timestamp for the event (epoch UTC ms) t text to display u status text for the event. This is used by the default fill function to highlight events. The known values are proposed, conflict and provisional.

Parameters

PropertyDescriptionTransitionPreview
classedString SVG custom classN
width, height, size, scaleInteger SVG container sizesY
styleString Custom CSS to inject into chartN
indexFormatString, Function Change the time presentation on the axis. If string, utilises d3-time-format. If a function, must be a comptabile formatter. Default %Hh
languageString Change the language, affects time formats. Typically auto detected from the browser.
timezoneString Set the timezone for display e.g. Asia/Colombo
prefixDurationFormatString Prefix the event text with start and end time
tickIntervalArray Interval of the ticks, typically an interval and a specifier e.g. d3.timeMinute.every(15)
eventWidthInteger Width to use for the event rects

Know isues

Timezones that differ from UTC with 30 or 45 min offsets do not present the correct boundaries.