Repository navigation
v0.9.0
Minor changes
-
3ae8f98: The Rust crate
kgdiff-layoutcarries a layout from one version of a graph to the next through their diff:layout_diff_on(&diff, &previous, &options)lays the diff out on the previous version's map, andlayout_after(&diff, &layout, &options)gives the after version the positions of its diff without computing any (RFC 0003, part 1). Every node the previous layout places stays exactly where it is, whether it continues or was removed and under whatever id it has now, and only the new nodes are placed, clear of the removed ones; going from a version to the next one, and from either to their diff, moves no node. Laying the next version out withlayout_graphand the previous positions as pins gives that only when no id changes: a node that continues under another id is placed again, and an id given to another node pins that node where the old one was. Both functions are held to thekgdiff.layoutbytes of the same pins written by hand on every case of the conformance corpus. A pin of the caller wins over the previous layout; scopeChangesand strategyUnionareinvalid-input, and so is, forlayout_after, a layout that does not place every node of the after version. The functions are experimental for one minor release, and@kgdiff/layouthas no counterpart. The embedding guide and its example (crates/kgdiff-report/examples/embedding.rs) now use them.@kgdiff/cli -
0a52a4d: The Rust crate
kgdiff-layoutlays out one graph:layout_graph(&graph, &options)gives the positionslayout_diffgives the diff of that graph with itself, with every node in scope whatever the size of the graph, so an application that shows a graph and then a diff of it moves no node between the two (RFC 0003, part 1). The two are held to the samekgdiff.layoutbytes on both graphs of every case of the conformance corpus. Known positions, as pins or aspositionon the nodes, are kept exactly and only the other nodes are placed, which is how the next version of a graph keeps the previous version's map; scopeChangesisinvalid-input. The function is experimental for one minor release.@kgdiff/layouthas no counterpart:@kgdiff/computewill export it with the rest of the layout (RFC 0002, phase 5).@kgdiff/cli -
6c3a764: The payload of an HTML report has a JSON Schema:
schema/report.v1.jsondescribeskgdiff.reportversion 1 (format,version, the diff, packed or not, the optionallayoutof version 1 or 2,metaand the optionalview), so an application that makes or reads reports can validate them as it can graphs, diffs and deltas. Members ofviewthe schema does not name are allowed: later minor versions add optional ones, and viewers ignore those they do not know. The schema andschema/layout.v2.json, the layout document of kgdiff's Rust engine it refers to, are exported as@kgdiff/core/schema/report.v1.jsonand@kgdiff/core/schema/layout.v2.json(layout.v2.jsonwas in the package already, without an export). In Rust, thekgdiff-reportcrate takes the layout of a report from its caller (RFC 0003, part 2):report_payload_withandbuild_report_html_withtake aReportLayout, which isDefault(the layout of the default options, whatreport_payloadandbuild_report_htmlkeep writing, byte for byte),Given(&layout)(a layout the application has already, checked against the diff and refused withinvalid-inputwhen it places a node the diff does not have, or has scopealland leaves one out) orNone(no layout: the viewer lays the diff out when the report opens). Whatkgdiffwrites does not change.@kgdiff/core -
d3e1dac: Layers: an application draws its own marks on the renderer's canvas, under and over the graph (RFC 0003, part 4a; experimental).
renderer.addLayer({ order, draw(ctx, view) })returns the function that removes the layer. Anunderlayer is drawn after the background and the dot grid and before everything else, anoverlayer after the labels: a background behind a group of nodes, a certification mark or a count on a node, without a second canvas that follows thecameraevent.drawis called once per painted frame (once per side in a swipe view, clipped to it, withview.side), in CSS pixels, withview.worldToScreen,view.camera,view.viewportandview.pixelRatio; the renderer saves the context before each layer and restores it after. Layers are intoDataURLand in theframeevent'sms, are not picked, and their text takes no part in label placement; a layer that throws is reported and the rest of the frame is painted. Without layers the renderer paints exactly as before.<kgdiff-stage>gains the sameaddLayermethod (experimental) for the graph inside the viewer: layers added before the stage has a canvas are drawn once it has one, and they stay with the stage when it is bound to another root or moved in the document.@kgdiff/viewerexports theRendererLayerandLayerViewtypes. Known limit: labels carry a halo in the canvas background color, which shows as a faint outline over a tintedunderarea; soft tints (the theme'ssoftcolors, about 10% alpha) keep it unnoticeable.@kgdiff/renderer·@kgdiff/viewer
Patch changes
-
9669b75: The canvas shows the whole frame under an emulated device scale factor. With Chromium's device emulation at a scale factor other than 1 (Playwright's
deviceScaleFactor, as used for screenshots and browser tests), the graph was drawn enlarged and blurred with only its top-left corner on the canvas, on the first view and after "Fit view": a CLI report, the viewer and any page withcreateRendereralike. The renderer sized the canvas's backing store by the browser's device-pixel box (devicePixelContentBoxSize), which stays in CSS pixels under that emulation, and painted atdevicePixelRatio. It now takes that box only when it is the canvas's CSS size times the pixel ratio, within the snapping to whole device pixels, and sizes the backing store by the pixel ratio otherwise, as it always has in browsers without the box. A real high-density display (the box is in device pixels there) was drawn correctly before and is drawn exactly as before. The same check keeps the backing store and the painting in step under a CSSzoomon an ancestor, which the box includes anddevicePixelRatiodoes not; the viewer's fits under a CSSzoomare still off.@kgdiff/renderer·@kgdiff/viewer
Every package is at 0.9.0: @kgdiff/cli · @kgdiff/core · @kgdiff/formats · @kgdiff/layout · @kgdiff/scene · @kgdiff/renderer · @kgdiff/viewer · @kgdiff/g6.
GitHub Action: uses: iiwish/kgdiff@v0.9.0.