Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ jobs:

# And M5's gates 13 and 14 in the same run: the canvas backend's call log per golden scene,
# against tests/Marey.Fable/canvas, and the fonts gate.
# In a zone that differs from every golden's, with summer time in the other half of the
# year: a time axis's tick or label that went through a JavaScript `Date` would follow it.
- name: The SVG goldens, the canvas logs and the fonts under Node
env:
TZ: Pacific/Auckland
run: node tests/Marey.Fable/out/Main.js tests/Marey.Tests/golden tests/Marey.Fable/canvas

# D121's consumer: the browser example compiles, so it cannot rot unseen. Serving it and
Expand Down Expand Up @@ -414,6 +418,8 @@ jobs:
dotnet fable tests/Marey.Fable -o tests/Marey.Fable/out-packages

- name: The SVG goldens, the canvas logs and the fonts under Node, from the packages
env:
TZ: Pacific/Auckland
run: node tests/Marey.Fable/out-packages/Main.js tests/Marey.Tests/golden tests/Marey.Fable/canvas

- name: Upload the documents that differ
Expand Down
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,41 @@ and reported when missing; Marey does not require a version of them.

## [Unreleased]

### Added

- **Dates and times on an axis.** An instant is seconds since 1970-01-01 00:00 UTC:
`Time.ofDates` makes them from `DateTime`s (a `DateTime` of kind `Unspecified` is UTC, as in
matplotlib), `Time.ofOffsets` from `DateTimeOffset`s, `Time.inZone zone` from a zone's naive wall
clocks (a time skipped by summer time moves forward, one read twice is the earlier), and
`Time.seconds` as raw numbers. `Chart.withXTime zone`, `withYTime` and `withRightYTime` read an
axis on a calendar in `TimeZone.utc`, `TimeZone.offset (h, m)`, `TimeZone.named "Europe/Berlin"`
or `TimeZone.local`: `ScaleKind.Time`. Its ticks fall on the zone's midnights, month starts and
whole hours, by integer arithmetic that is the same under .NET and Node; its labels are concise
and culture-independent (`27`, `14:00`, `Mar`, `2027`); the zone is in the title's bracket and
what every tick shares after the label, `t, Mar 2026 [Europe/Berlin]`. `TicksCalendar`,
`MinorCalendar` and `FormatDate` state calendar ticks and date patterns (`withXTicksCalendar`,
`withXDateFormat`); `withXTimeDomain` takes two `DateTime`s; `withTopAxisElapsed` and
`withTopAxisTime` read elapsed time over instants and the other way round. A time axis meets
only time axes in its own zone, and the refusal names both kinds or zones. The pointer reads an
instant to the pixel, a live zoom reaches a microsecond, and a shot keeps one title across a pan
through midnight. C#: `Time.OfDates`, `.WithXTime(TimeZones.Named("Europe/Berlin"))`.
- **Logit and asinh scales.** `Chart.withXLogit` and `withYLogit` (`ScaleKind.Logit`) for
probabilities, ticked `0.001 0.01 0.1 0.5 0.9 0.99 0.999` and `1−10⁻⁴` past them, read in the
probability; a dimensioned axis is refused, naming the unit, and values outside (0, 1) are not
drawn and are counted on the panel. `withXAsinh` and `withYAsinh` (`ScaleKind.Asinh`) for signed
data over decades, linear near zero and smooth where symlog has a kink, ticked at zero and ±10ᵏ.
C#: `.WithYLogit()`, `.WithYAsinh(1.0)`.
- **Rasterised layers in vector output.** `Chart.withRasterized dpi` (`Layer.Rasterize`) draws a
layer as one image inside a vector figure, as matplotlib's `rasterized=True` does: 10⁵
translucent points are 1.1 MB of PDF, not 16.3 MB, with the axes and text still text. The Skia
backend's PDF does it; `SkiaBackend.rasterizeMarked` does it for an SVG or TikZ figure in .NET.
Elsewhere, under Fable included, the layer stays vector. C#: `.WithRasterized(300)`.
- **EPS.** `SkiaBackend.renderEps` and `renderEpsToFile` convert the PDF with Ghostscript, or
`pdftops` without it (`Eps.ofPdf` in `Marey.Toolchain`); with neither on `PATH` the error names
both. Fonts stay embedded; transparency is flattened. C#: `EpsRenderer.Render`.
- `examples/lab-log.fsx`: four days of a lab's log across the change to summer time, with a second
y axis, elapsed hours along the top and a zoom onto one day.

## [1.0.0] — 2026-11-23

### Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The package list and the reason for each entry are in `.github/tex-packages.txt`

## Golden baselines

The baselines are tracked under `tests/Marey.Tests/golden/`, 40 in SVG and 42 in `tikzpicture`
The baselines are tracked under `tests/Marey.Tests/golden/`, 46 in SVG and 48 in `tikzpicture`
source. They
are text, meant to be reviewed as a diff, which is why both formats were chosen.

Expand Down
17 changes: 17 additions & 0 deletions api/Marey.Backend.Skia.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ namespace Marey
val renderPngToFile:
path: string -> extent: Extent<px> -> node: Node -> unit

val rasterizeMarkedWith:
options: SkiaOptions -> extent: Extent<px> -> node: Node -> Node

val rasterizeMarked: extent: Extent<px> -> node: Node -> Node

val renderPdf: extent: Extent<px> -> node: Node -> byte array

val renderPdfWith:
Expand All @@ -169,6 +174,11 @@ namespace Marey
val renderPdfToFile:
path: string -> extent: Extent<px> -> node: Node -> unit

val renderEps: extent: Extent<px> -> node: Node -> byte array

val renderEpsToFile:
path: string -> extent: Extent<px> -> node: Node -> unit

namespace Marey.CSharp

[<AbstractClass; Sealed; Class>]
Expand All @@ -184,3 +194,10 @@ namespace Marey.CSharp
static member
Render: extent: Marey.Extent<Marey.px> * node: Marey.Node ->
byte array

[<AbstractClass; Sealed; Class>]
type EpsRenderer =

static member
Render: extent: Marey.Extent<Marey.px> * node: Marey.Node ->
byte array
43 changes: 43 additions & 0 deletions api/Marey.Core.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,35 @@ namespace Marey
when (Interpolate or ^T) :
(static member Interp: ^T * ^T * float -> ^T)

namespace Marey

type TimeZone =
{ Id: string }

[<RequireQualifiedAccess>]
type CalendarUnit =
| Second
| Minute
| Hour
| Day
| Week
| Month
| Year

[<RequireQualifiedAccess;
CompilationRepresentation (enum<CompilationRepresentationFlags> (4))>]
module TimeZone =

val utc: TimeZone

val offset: hours: int * minutes: int -> TimeZone

val named: id: string -> TimeZone

val local: TimeZone

val offsetAt: zone: TimeZone -> t: float -> float

namespace Marey

[<RequireQualifiedAccess>]
Expand All @@ -667,6 +696,12 @@ namespace Marey

| Ordinal of levels: string array

| Time of zone: TimeZone

| Logit

| Asinh of linearWidth: float

type Scale<[<Measure>] 'u> =
{

Expand Down Expand Up @@ -703,6 +738,14 @@ namespace Marey
b: float ->
linthresh: float -> u: U<'u> -> float<'u> * float<'u> -> Scale<'u>

val time:
zone: TimeZone -> u: U<'u> -> float<'u> * float<'u> -> Scale<'u>

val logit: u: U<'u> -> float<'u> * float<'u> -> Scale<'u>

val asinh:
linearWidth: float -> u: U<'u> -> float<'u> * float<'u> -> Scale<'u>

val levelLabel: levels: string array -> v: float -> string

val ordinal: levels: string array -> Scale<1>
Expand Down
Loading
Loading