0.24.7 • Published 5 months ago

@intoto-dev/bibliotheca-profile v0.24.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

<Profile /> component

Live Demo

Profile stands for river profile. It allows rendering of a cross-section of a river. The current water-level, mean level, and a generated bridge can be added.

Example Graph

Installation

Add Profile to your project with the following command:

npm i @intoto-dev/bibliotheca-profile

Basic Usage

The only required property to pass is profile which contains a list of points to draw the cross-section. Each item is an object consisting of x and msl, x being the x-coordinate in meters and msl being meters above sea level.

import { Profile } from '@intoto-dev/bibliotheca-profile';

const profile = [
  { x: 0, y: 10 },
  { x: 2, y: 8 },
  { x: 3, y: 7 },
  { x: 6, y: 7 },
  { x: 7, y: 8 },
  { x: 9, y: 10 },
]; // Array of profile points

<Profile profile={profile} />;

Future Work

  • Add a custom bridge polygon to visualise the true shape of the bridge.

API

React Component: <Profile />

import { Profile } from '@intoto-dev/bibliotheca-profile';
PropertyDescriptionTypeDefault
profile *List of points to draw the cross-section.ProfilePoint[]
widthWidth of the profile in pixels. Pass the width of a parent container to make it "responsive".number600
currentWaterLevelCurrent water level in meters above sea level.number
bridgeLevelIf you want to add a bridge, pass the meters above sea level here of the bottom of the bridge.number
bridgeHeightHeight in meters of the bridge. This is to render the railing.number1.2
bridgeStrokeWidthStroke width of the bridge in pixels.number2
bridgeStrokeColorHexadecimal color ot the stroke of the bridge.string#000
meanLevelMean level in meters above sea level. Provide if you want to show an indicator line.number
axisWhether or not to show the Y-axis.booleanfalse
mslLabelThe label used on the Y-axis to indicate the MSL.string'MASL'
meanLabelThe label used in the legend to indicate the mean level.string'Mean-level'
meanStrokeColorHexadecimal color of the stroke of the mean level.string'#b7323f'
formatDistanceA function to format the distance between two points. Comes in handy with conversions etc.(centimeters: number) => string
strokeWidthStroke width of the profile in pixels.number1.5
strokeColorHexadecimal color of the stroke.string'#000'
waterStrokeColorHexadecimal color of the stroke of the water.string'#0633ff'
waterFillHexadecimal color of the fill of the water.string'#99ccff'
groundFillHexadecimal color of the fill of the ground.string'#b4967d'
groundGradientWhether or not to render the ground fill as a gradientbooleantrue
groundStrokeWhether or not to the ground fill has as a strokebooleanfalse

Type: ProfilePoint

PropertyDescriptionType
x *X-coordinate of the point in meters.number
msl *Y-coordinate of the point in meters above sea level.number
0.24.7

5 months ago

0.24.6

5 months ago

0.23.6

8 months ago

0.23.5

8 months ago

0.23.4

8 months ago

0.23.3

8 months ago

0.23.9

8 months ago

0.23.8

8 months ago

0.23.7

8 months ago

0.23.10

8 months ago

0.24.5

6 months ago

0.24.4

7 months ago

0.24.3

7 months ago

0.24.2

7 months ago

0.24.1

8 months ago

0.23.2

2 years ago

0.23.1

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.17.2

2 years ago

0.19.1

2 years ago

0.17.3

2 years ago

0.19.2

2 years ago

0.17.4

2 years ago

0.19.3

2 years ago

0.17.5

2 years ago

0.15.0

2 years ago

0.17.0

2 years ago

0.17.1

2 years ago

0.23.0

2 years ago

0.21.2

2 years ago

0.21.1

2 years ago

0.21.0

2 years ago

0.18.1

2 years ago

0.18.2

2 years ago

0.16.0

2 years ago

0.14.2

2 years ago

0.18.0

2 years ago

0.22.0

2 years ago

0.11.0

2 years ago

0.11.1

2 years ago

0.13.0

2 years ago

0.11.2

2 years ago

0.11.3

2 years ago

0.11.4

2 years ago

0.9.0

2 years ago

0.9.2

2 years ago

0.10.1

2 years ago

0.12.0

2 years ago

0.14.0

2 years ago

0.14.1

2 years ago

0.10.0

2 years ago

0.8.1

2 years ago

0.6.3

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.6.2

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.3.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.1.10

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.22

2 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago