0.0.14 • Published 8 months ago

@agnosticeng/dv v0.0.14

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

@agnosticeng/dv

A lightweight, customizable data visualization library for Svelte applications.

Features

  • 📊 Interactive Data Table

    • Sortable columns
    • Resizable columns
    • Light/Dark theme support
    • Type-aware formatting
    • Fixed headers
    • Custom styling options
  • 📈 Charts

    • Line charts
    • Candlestick charts
    • Responsive design
    • Automatic scaling
    • Multiple series support

Installation

npm install @agnosticeng/dv

Usage

Data Table

<script>
import { Table } from '@agnosticeng/dv';

const columns = [
  { name: 'id', type: 'Int32' },
  { name: 'name', type: 'String' },
  { name: 'date', type: 'DateTime' },
  { name: 'value', type: 'Float64' }
];

const data = [
  { id: 1, name: 'Item 1', date: '2023-01-01', value: 100.5 },
  { id: 2, name: 'Item 2', date: '2023-01-02', value: 200.75 }
];
</script>

<Table {data} {columns} theme="dark" />

Charts

<script>
import { Chart } from '@agnosticeng/dv';

const data = [
  { date: '2023-01-01', value: 100.5 },
  { date: '2023-01-02', value: 200.75 }
];

const settings = {
  chartType: 'line',
  xAxis: {
    series: ['date']
  },
  yAxis: {
    series: ['value']
  }
};
</script>

<Chart {data} {settings} />

API Reference

Table Props

PropTypeDefaultDescription
dataArray<Object>requiredData to be displayed in the table
columnsArray<Column>requiredColumn definitions
theme'light' \| 'dark''dark'Table theme

Chart Props

PropTypeDefaultDescription
dataArray<Object>requiredData to be visualized
settingsChartSettingsrequiredChart configuration

Types

type Column = {
  name: string;
  type: string;
};

type ChartSettings = {
  chartType: 'candle' | 'line';
  xAxis: {
    series: string[];
  };
  yAxis: {
    series: string[];
  };
};

Features

Table

  • Column sorting (click header)
  • Column resizing (drag header edge)
  • Automatic type formatting
  • Alternating row colors
  • Sticky headers
  • Hover effects

Charts

  • Automatic scaling
  • Responsive layout
  • Multiple series support
  • Grid lines
  • Customizable margins
  • Automatic tick formatting

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

0.0.14

8 months ago

0.0.13

8 months ago

0.0.12

9 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago