0.2.2 • Published 6 months ago

@kurrawongai/kai-ui v0.2.2

Weekly downloads
-
License
BSD-3-Clause
Repository
github
Last release
6 months ago

KAI UI

A Vue.js component library for use in Kurrawong tools.

Contents

Install

To add kai-ui to your project, simply run:

npm install @kurrawongai/kai-ui

or

pnpm add @kurrawongai/kai-ui

You may also need to import KAI-UI's stylesheet ("kai-ui/kai-ui.css").

Components

Editor

A base Monaco code editor with support for multiple languages, including RDF languages.

Editor component

OpenLayers Map

An interactive OpenLayers Map that supports loading WKT & geoJSON features.

Supported Languages

  • CSS
  • HTML
  • Java
  • JavaScript
  • JSON
  • Markdown
  • N3
  • N-Quads
  • N-Triples
  • Python
  • SHACL
  • SPARQL
  • TriG
  • Turtle
  • TypeScript
  • XML
  • YAML

Props

propdescriptiontyperequireddefault
languagesWhat languages are available to choose fromstring[], see above for supported languagesall are enabled by default
hideToolbarHides the tool bar at the top of the editorbooleanfalse
optionsMonaco editor optionsSee the available options from Monaco{ automaticLayout: true, minimap: { enabled: false }, stickyScroll: { enabled: false }, scrollBeyondLastLine: false, }
hideLanguageHides the language selectorbooleanfalse
hideThemeHides the theme selectorbooleanfalse
hideCopyButtonHides the copy buttonbooleanfalse
hideClearButtonHides the clear buttonbooleanfalse
hideUploadButtonHides the upload buttonbooleanfalse
hideDownloadButtonHides the download selectorbooleanfalse
disableDragDisabled drag and dropbooleanfalse
readonlySets the editor to read only. Also hides the upload & clear buttonsbooleanfalse
downloadFilenameSets the name of the file for downloadstring"output"
directDownloadDownloads the file directly instead of a popup for renaming the downloaded file namebooleanfalse
classPassthrough for applying CSS classesstring

Models

modeldescriptiontyperequireddefault
-The value or content of the editorstring
languageThe current language of the editorstring, see above"text"
themeThe color theme of the editor"light" \| "dark" \| "system""system"

OpenLayers Map

An interactive OpenLayers Map that supports loading WKT & geoJSON features.

Map component

Props

propdescriptiontyperequireddefault
centerWhere to center the mapnumber[], array of 2 coordinates133.7751, -25.2744
zoomZoom levelnumber4
rotationMap rotationnumber0
projectionProjection to use, make sure this matches the datastring'EPSG:4326'
focusSourceRefPassed through to vue3-openlayersSources.OlSourceVectornull
layersLayers of GeoJSON FeatureCollections to include in the map on load{ type: "FeatureCollection"; title: string; features: { type: "Feature"; name: string; wkt?: string; geoJSON?: any; }[]; mapStyle?: MapStyle; }[] see drawStyle type for MapStyleOptions[]
loadingDisplay a "Loading" modal on the map, useful when loading databooleanfalse
drawEnabledEnable "Draw mode", allowing the user to draw on the Mapbooleanfalse
mapStyleSets the default layer styles for view, hover & select states{ style?: MapStyleOptions; hoverStyle?: MapStyleOptions; selectStyle?: MapStyleOptions; } see drawStyle type for MapStyleOptionssee consts.ts for default styles
drawStyleSets the layer style for drawing geometries{ strokeWidth?: number; strokeColor?: string; fillColor?: string; pointRadius?: number; pointStrokeWidth?: number; pointStrokeColor?: string; pointFillColor?: string; }see consts.ts for default styles

Events

eventdescriptionparameters
selectFired when the user selects (clicks) a featurefeature
hoverFired when the user hovers over a featurefeature
drawstartFired when the user starts drawingfeature
drawendFired when a feature is fully drawn by the userfeature

Development

To install:

pnpm install

To run locally:

pnpm dev

License

This code is available for reuse according to the BSD 3-Clause License.

© 2025 KurrawongAI