Skip to content

Repository files navigation

Pure.Chart.Model

Concrete implementations of the chart domain model for the Pure ecosystem — immutable, AOT-compatible records implementing the Pure.Chart.Model.Abstractions contracts.

.NET build & testBuild and DeployNuGetLicense: MIT

Overview

Pure.Chart.Model provides sealed record implementations of the chart abstractions defined in Pure.Chart.Model.Abstractions. Each type is immutable by construction, taking all values through its constructor, and depends on IString from Pure.Primitives.Abstractions for all string-valued properties.

Types

TypeImplementsDescription
ChartIChartRoot chart record — holds title, description, type, two axes, and a series collection
AxisIAxisSingle axis with a legend label
ChartSeriesIChartSeriesA data series with a legend and source column names for each axis
ChartTypeIChartTypeNamed chart type (e.g. bar, line, pie)

All types reside in the Pure.Chart.Model namespace.

Design Principles

  • Immutable — all properties are init-only; values are set once in the constructor and never changed.
  • ComposableChart aggregates IAxis, IChartType, and IEnumerable<IChartSeries>, all of which are abstractions, so any implementation can be substituted.
  • AOT-compatible — sealed records with no reflection or dynamic dispatch; the package is fully compatible with Native AOT.

Dependencies

Target Frameworks

  • .NET 7
  • .NET 8
  • .NET 9
  • .NET 10

Installation

dotnet add package Pure.Chart.Model

Usage

usingPure.Chart.Model;usingPure.Primitives.Abstractions.String;// Assuming MyString : IString is provided by your primitives implementationIStringtitle=newMyString("Sales 2024");IStringdescription=newMyString("Monthly revenue by region");IStringtypeName=newMyString("bar");IStringxLegend=newMyString("Month");IStringyLegend=newMyString("Revenue");IStringseriesName=newMyString("EMEA");IStringxSource=newMyString("month_col");IStringySource=newMyString("revenue_col");varchart=newChart(title,description,newChartType(typeName),newAxis(xLegend),newAxis(yLegend),[newChartSeries(seriesName,xSource,ySource)]);

About

Concrete immutable record implementations of the chart domain model for the Pure ecosystem — implements Pure.Chart.Model.Abstractions contracts.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

Generated from kudima03/Pure.Template