2.1.2 • Published 4 years ago

@bdk-pixi/core v2.1.2

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
4 years ago

Package Contents @bdk-pixi/core

Colors (colors.js)

Layout colors and shades are defined here in accordance with the design specification. Colors sensitive to a theme are defined within it's themes' key in the colors object.

There are a number of text and background shades which would be difficult to define by name, so instead they are defined in a list ordered lightest to darkest. Colors not sensitive to theme are given a name and stored at the root of the object.

How to use

import { colors } from "@bdk-pixi/core";

function ThemedElement({ theme, trainCancelled }) {
  return (
    <div
      style={{
        color: trainCancelled
          ? // Named color
            colors.red
          : // Themed text shade
            colors[theme].text[3],
        background: colors[theme].background[1]
      }}
    >
      I'm themed
    </div>
  );
}

Flow Types (index.flow.js)

The central store of shared Flow types. These types are used throughout packages in this mono-repo and also applications which use this package.

Primarily this file contains typings for the data-schema of trains, defining both PayloadTrain which is the schema we receive from the source, and Train the transformed schema which is useful for us to use in all applications.

How to use

Flow Documentation

import type { PayloadTrain, Train } from "@bdk-pixi/core";

function parseTrain(payloadTrain: PayloadTrain): Train {
  // Transform the data into some meaningful information
  return newTrain;
}

Train Status (train_status.js)

The TrainStatus React Component expects to recieve a list of trains from a defined WebSocket source and parses each train so it is more useful in our applications. It handles receiving messages as they arrive and will report network errors when they occur. Current sources sending messages are the "Departues", "Arrivals" and "Track" API.

There is a list of functions which parse each trains' data to make them useful in React applications.

For example, the source provides a Routes list for each train. We use this list to derive the stopping patterns which the train will take course. We also use the Routes list to derive the make-up of Wagons (or carriages) of the train. Stopping patterns and Wagon visualisations are critical pieces of information for passangers which require very different logic to be rendered correctly for all trains and situations. Therefore we make this distinction at the "top" of the information flow to make it easier to render in the layout it's destined for.

Filtering departed trains for platform screens...

Notices and "notice" trains...

...this document is WIP

2.1.2

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

3.0.0-beta.9

5 years ago

3.0.0-beta.7

5 years ago

3.0.0-beta.6

5 years ago

3.0.0-beta.5

5 years ago

3.0.0-beta.4

5 years ago

3.0.0-beta.3

5 years ago

3.0.0-beta.2

5 years ago

3.0.0-beta.1

5 years ago

3.0.0-beta.0

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

3.0.0-alpha.3

5 years ago

3.0.0-alpha.2

5 years ago

3.0.0-alpha.1

5 years ago

3.0.0-alpha.0

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.1

5 years ago

0.1.5

5 years ago

2.0.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.2-alpha.0

5 years ago