npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@redsift/ui-rs-schedule

v0.1.0

Published

A customizable schedule component.

Downloads

6

Readme

ui-rs-schedule

ui-rs-schedule is a component for creating a customizable scheduler component for your application, e.g. to show events on a timeline. It is provided as a custom element for easy integration into your projects.

If your browser does NOT support custom elements natively (see caniuse) you have to install the web components shim and include it in your project before including this component!

The component is part of the RedsiftUI library. For a documentation of the hero unit see the official RedsiftUI documentation.

Builds

Circle CI

A UMD build is available from //static.redsift.io/reusable/ui-rs-schedule/latest/ui-rs-schedule.umd-es2015.min.js.

To build locally checkout this repository and

> cd ui-rs-schedule
> npm install
> npm run build

This will create a ./dist folder with the Javascript and CSS files.

Browser Usage

Include the Javascript on the bottom of the <body>:

<script src="https://d3js.org/d3.v4.0.0-alpha.35.js"></script>
<script src="//static.redsift.io/reusable/ui-rs-schedule/latest/js/ui-rs-schedule.umd-es2015.min.js"></script>

Including the Javascript already registers the custom element rs-schedule with the browser. Make sure to include D3v4 before the component, as it depends on it!

Use the following HTML code to create a rs-schedule element:

<rs-schedule></rs-schedule>

Data is added to the chart via Javascript in the following form:

var data = [
    {
        "start": Date.parse("2016-04-13T14:30:00+01:00")
    },
    {
        "end": Date.parse("2016-04-13T18:30:00+01:00")
    },
    {
        "status":"confirmed",
        "summary": "Confirmed overlap event",
        "self": true,
        "start": Date.parse("2016-04-13T16:30:00+01:00"),
        "end": Date.parse("2016-04-13T18:30:00+01:00")
    },
    {
        "status":"tentative",
        "summary": "Tentative event",
        "self": false,
        "start": Date.parse("2016-04-13T15:00:00+01:00"),
        "end": Date.parse("2016-04-13T16:00:00+01:00")
    },
    {
        "status":"proposed",
        "summary": "Suggested event of some significant length",
        "self": false,
        "start": Date.parse("2016-04-13T16:00:00+01:00"),
        "end": Date.parse("2016-04-13T17:00:00+01:00")
    },
];

var chart = document.querySelector('rs-schedule');
chart.width = 600;
chart.data = data;

CAUTION:

If your browser does not support custom elements (and only then!) make sure to wrap the above code into the following code:

window.addEventListener('WebComponentsReady', function(e) {
  // setup code ...
});

See a description of why this is necessary here.

Development Setup

For development run

> npm run serve

within the repository folder. It will start a web server serving the content of ./samples and supports live-reloading when a source file is changed.