ranger-compiler 3.5.0 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1160 -19
- package/LICENSE +3 -1
- package/README.md +124 -29
- package/dist/Lang.rgr +1188 -290
- package/dist/api.d.ts +2343 -879
- package/dist/api.js +79924 -56922
- package/dist/lib/JSON.rgr +102 -91
- package/dist/lib/Shell.rgr +4 -4
- package/dist/lib/apple/AppleToolchain.rgr +4 -4
- package/dist/lib/apple/README.md +5 -4
- package/dist/lib/apple/apple_test.rgr +1 -1
- package/dist/lib/core/README.md +1 -1
- package/dist/lib/evg/EVG.rgr +12 -0
- package/dist/lib/evg/EVGA11yFromTree.rgr +302 -0
- package/dist/lib/evg/EVGA11yTree.rgr +894 -0
- package/dist/lib/evg/EVGBox.rgr +267 -0
- package/dist/lib/evg/EVGBoxShorthandTest.rgr +220 -0
- package/dist/lib/evg/EVGCodepoint.rgr +316 -0
- package/dist/lib/evg/EVGColor.rgr +700 -0
- package/dist/lib/evg/EVGCommands.rgr +177 -0
- package/dist/lib/evg/EVGComponent.rgr +331 -0
- package/dist/lib/evg/EVGComponentTest.rgr +387 -0
- package/dist/lib/evg/EVGConnector.rgr +541 -0
- package/dist/lib/evg/EVGConnectorTest.rgr +306 -0
- package/dist/lib/evg/EVGDisplayList.rgr +4186 -0
- package/dist/lib/evg/EVGEasing.rgr +370 -0
- package/dist/lib/evg/EVGEffectTest.rgr +253 -0
- package/dist/lib/evg/EVGElement.rgr +4914 -0
- package/dist/lib/evg/EVGFixedTest.rgr +289 -0
- package/dist/lib/evg/EVGFlexRulesTest.rgr +317 -0
- package/dist/lib/evg/EVGFlexWrapTest.rgr +246 -0
- package/dist/lib/evg/EVGFling.rgr +244 -0
- package/dist/lib/evg/EVGFocus.rgr +400 -0
- package/dist/lib/evg/EVGFocusTest.rgr +399 -0
- package/dist/lib/evg/EVGGradient.rgr +322 -0
- package/dist/lib/evg/EVGGrapheme.rgr +190 -0
- package/dist/lib/evg/EVGGrid.rgr +975 -0
- package/dist/lib/evg/EVGHitTest.rgr +208 -0
- package/dist/lib/evg/EVGHoles.rgr +294 -0
- package/dist/lib/evg/EVGHostMeasurerTest.rgr +281 -0
- package/dist/lib/evg/EVGHostTextMeasurer.rgr +331 -0
- package/dist/lib/evg/EVGHostTree.rgr +834 -0
- package/dist/lib/evg/EVGHostTreeTest.rgr +447 -0
- package/dist/lib/evg/EVGImageDecode.rgr +117 -0
- package/dist/lib/evg/EVGImageMeasurer.rgr +86 -0
- package/dist/lib/evg/EVGInspect.rgr +883 -0
- package/dist/lib/evg/EVGInvalidateTest.rgr +432 -0
- package/dist/lib/evg/EVGJsonTest.rgr +535 -0
- package/dist/lib/evg/EVGLayout.rgr +4220 -0
- package/dist/lib/evg/EVGMeasure.rgr +1267 -0
- package/dist/lib/evg/EVGOverlayTest.rgr +626 -0
- package/dist/lib/evg/EVGPatch.rgr +1721 -0
- package/dist/lib/evg/EVGPatchTest.rgr +692 -0
- package/dist/lib/evg/EVGPopoverTest.rgr +395 -0
- package/dist/lib/evg/EVGReconcile.rgr +226 -0
- package/dist/lib/evg/EVGReconcileTest.rgr +421 -0
- package/dist/lib/evg/EVGReject.rgr +126 -0
- package/dist/lib/evg/EVGRelayoutTest.rgr +375 -0
- package/dist/lib/evg/EVGRtlLayoutTest.rgr +319 -0
- package/dist/lib/evg/EVGRuler.rgr +232 -0
- package/dist/lib/evg/EVGRulerTest.rgr +172 -0
- package/dist/lib/evg/EVGSelectChrome.rgr +178 -0
- package/dist/lib/evg/EVGStyleCacheTest.rgr +419 -0
- package/dist/lib/evg/EVGStyleSheet.rgr +2148 -0
- package/dist/lib/evg/EVGStyleStateTest.rgr +407 -0
- package/dist/lib/evg/EVGStyleVarTest.rgr +471 -0
- package/dist/lib/evg/EVGText.rgr +105 -0
- package/dist/lib/evg/EVGTextEngine.rgr +536 -0
- package/dist/lib/evg/EVGTextMeasurer.rgr +720 -0
- package/dist/lib/evg/EVGTimingTest.rgr +1417 -0
- package/dist/lib/evg/EVGToolbar.rgr +1369 -0
- package/dist/lib/evg/EVGTransition.rgr +728 -0
- package/dist/lib/evg/EVGTreeJson.rgr +721 -0
- package/dist/lib/evg/EVGUnit.rgr +554 -0
- package/dist/lib/evg/EVGViewportUnitTest.rgr +236 -0
- package/dist/lib/evg/EvgApp.rgr +189 -0
- package/dist/lib/evg/EvgBitmapTracer.rgr +4277 -0
- package/dist/lib/evg/EvgBitmapTracerTest.rgr +2119 -0
- package/dist/lib/evg/EvgHost.rgr +451 -0
- package/dist/lib/evg/EvgTest.rgr +91 -0
- package/dist/lib/evg/EvgTraceColor.rgr +236 -0
- package/dist/lib/evg/EvgTraceCurve.rgr +648 -0
- package/dist/lib/evg/EvgTraceFit.rgr +767 -0
- package/dist/lib/evg/EvgTracePath.rgr +435 -0
- package/dist/lib/evg/EvgTraceTypes.rgr +559 -0
- package/dist/lib/evg/EvgViewport.rgr +313 -0
- package/dist/lib/evg/FxDemoDoc.rgr +185 -0
- package/dist/lib/evg/HOSTS.md +227 -0
- package/dist/lib/evg/ISSUES.md +835 -0
- package/dist/lib/evg/PLAN_ACCESSIBILITY.md +650 -0
- package/dist/lib/evg/PLAN_CSS_LAYOUT_AND_FONTS.md +1124 -0
- package/dist/lib/evg/PLAN_EFFECTS.md +431 -0
- package/dist/lib/evg/PLAN_EVG.md +518 -0
- package/dist/lib/evg/PLAN_EVG_RENDERER.md +1674 -0
- package/dist/lib/evg/PLAN_INSPECTOR.md +788 -0
- package/dist/lib/evg/PLAN_LINKS_AND_FORMS.md +157 -0
- package/dist/lib/evg/PLAN_NATIVE_HOSTS.md +671 -0
- package/dist/lib/evg/PLAN_VECTOR_IR.md +664 -0
- package/dist/lib/evg/PLAN_VIEW_TRANSFORM.md +322 -0
- package/dist/lib/evg/PathBuilder.rgr +333 -0
- package/dist/lib/evg/README.md +1236 -0
- package/dist/lib/evg/SPEC.md +1252 -0
- package/dist/lib/evg/SVGPathParser.rgr +1199 -0
- package/dist/lib/evg/SvgParser.rgr +1736 -0
- package/dist/lib/evg/TODO_EVG_RENDERER.md +595 -0
- package/dist/lib/evg/VectorShapes.rgr +331 -0
- package/dist/lib/evg/VectorStroke.rgr +107 -0
- package/dist/lib/evg/VectorViewBox.rgr +380 -0
- package/dist/lib/evg/agent/README.md +290 -0
- package/dist/lib/evg/agent/evg_agent.rgr +899 -0
- package/dist/lib/evg/agent/fixtures/broken.evg.json +7 -0
- package/dist/lib/evg/agent/fixtures/card.evg.json +9 -0
- package/dist/lib/evg/agent/fixtures/connector.css +63 -0
- package/dist/lib/evg/agent/fixtures/connector.evg.json +14 -0
- package/dist/lib/evg/agent/fixtures/drawn.evg.json +129 -0
- package/dist/lib/evg/agent/fixtures/gradient.evg.json +4 -0
- package/dist/lib/evg/agent/fixtures/popover.css +99 -0
- package/dist/lib/evg/agent/fixtures/popover.evg.json +30 -0
- package/dist/lib/evg/agent/roundtrip.sh +74 -0
- package/dist/lib/evg/agent/smoke.sh +230 -0
- package/dist/lib/evg/android/README.md +97 -0
- package/dist/lib/evg/android/androidstubs/AndroidStubs.kt +175 -0
- package/dist/lib/evg/android/androidstubs/Annotation.kt +10 -0
- package/dist/lib/evg/android/androidstubs/App.kt +30 -0
- package/dist/lib/evg/android/androidstubs/Content.kt +41 -0
- package/dist/lib/evg/android/androidstubs/ContentRes.kt +12 -0
- package/dist/lib/evg/android/androidstubs/InputMethod.kt +46 -0
- package/dist/lib/evg/android/androidstubs/Net.kt +6 -0
- package/dist/lib/evg/android/androidstubs/Os.kt +30 -0
- package/dist/lib/evg/android/androidstubs/Util.kt +15 -0
- package/dist/lib/evg/android/androidstubs/View.kt +113 -0
- package/dist/lib/evg/android/androidstubs/Widget.kt +16 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/AndroidEvgSurface.kt +323 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/AndroidTextMeasurer.kt +56 -0
- package/dist/lib/evg/android/src/android/kotlin/fi/ranger/evg/RippleEffect.kt +262 -0
- package/dist/lib/evg/android/src/awt/kotlin/fi/ranger/evg/AwtEvgSurface.kt +238 -0
- package/dist/lib/evg/android/src/awt/kotlin/fi/ranger/evg/AwtTextMeasurer.kt +85 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgEngineThread.kt +115 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgPainter.kt +231 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/EvgSurface.kt +117 -0
- package/dist/lib/evg/android/src/main/kotlin/fi/ranger/evg/RecordingSurface.kt +94 -0
- package/dist/lib/evg/apple/README.md +128 -0
- package/dist/lib/evg/apple/Sources/CoreGraphicsEvgSurface.swift +329 -0
- package/dist/lib/evg/apple/Sources/CoreTextMeasurer.swift +70 -0
- package/dist/lib/evg/apple/Sources/EvgEngineQueue.swift +105 -0
- package/dist/lib/evg/apple/Sources/EvgPainter.swift +225 -0
- package/dist/lib/evg/apple/Sources/EvgSurface.swift +163 -0
- package/dist/lib/evg/apple/Sources/RecordingSurface.swift +110 -0
- package/dist/lib/evg/bench/EvgLayoutBench.rgr +34 -0
- package/dist/lib/evg/bench/README.md +64 -0
- package/dist/lib/evg/bench/layout-bench.mjs +316 -0
- package/dist/lib/evg/bench/layout-cases.mjs +510 -0
- package/dist/lib/evg/bench/layout-conformance.mjs +254 -0
- package/dist/lib/evg/bin/.gitignore +17 -0
- package/dist/lib/evg/evg_test.rgr +313 -0
- package/dist/lib/evg/gl/README.md +198 -0
- package/dist/lib/evg/gl/a11y-paint-check.mjs +73 -0
- package/dist/lib/evg/gl/blur-check.mjs +399 -0
- package/dist/lib/evg/gl/boxmodel.json +1 -0
- package/dist/lib/evg/gl/demo.html +46 -0
- package/dist/lib/evg/gl/effect-presets.css +285 -0
- package/dist/lib/evg/gl/effect-presets.js +63 -0
- package/dist/lib/evg/gl/effect-shots.mjs +135 -0
- package/dist/lib/evg/gl/evg-a11y.js +566 -0
- package/dist/lib/evg/gl/evg-binary.js +160 -0
- package/dist/lib/evg/gl/evg-engine.js +296 -0
- package/dist/lib/evg/gl/evg-fx.js +237 -0
- package/dist/lib/evg/gl/evg-gestures.js +209 -0
- package/dist/lib/evg/gl/evg-list.js +167 -0
- package/dist/lib/evg/gl/evg-measure.js +186 -0
- package/dist/lib/evg/gl/evg-textinput.js +303 -0
- package/dist/lib/evg/gl/evg-view.js +144 -0
- package/dist/lib/evg/gl/evg-webgl.js +3942 -0
- package/dist/lib/evg/gl/fx-check.mjs +998 -0
- package/dist/lib/evg/gl/fx-demo.html +166 -0
- package/dist/lib/evg/gl/fx-demo.js +2 -0
- package/dist/lib/evg/gl/fx-serve.mjs +47 -0
- package/dist/lib/evg/gl/gestures-check.mjs +189 -0
- package/dist/lib/evg/gl/list-binary-check.mjs +152 -0
- package/dist/lib/evg/gl/measure-check.mjs +135 -0
- package/dist/lib/evg/gl/rotation-check.mjs +207 -0
- package/dist/lib/evg/gl/shift-check.mjs +113 -0
- package/dist/lib/evg/gl/stroke-check.mjs +168 -0
- package/dist/lib/evg/gl/text-snap-check.mjs +139 -0
- package/dist/lib/evg/gl/view-check.mjs +343 -0
- package/dist/lib/evg/gl/view-policy-check.mjs +184 -0
- package/dist/lib/evg/html/evg-dom.js +318 -0
- package/dist/lib/evg/html/evg-html.js +600 -0
- package/dist/lib/evg/inspect/README.md +415 -0
- package/dist/lib/evg/inspect/browser-smoke.mjs +115 -0
- package/dist/lib/evg/inspect/evg-inspect.js +947 -0
- package/dist/lib/evg/inspect/shots/css.png +0 -0
- package/dist/lib/evg/inspect/shots/dashboard.png +0 -0
- package/dist/lib/evg/inspect/shots/pptx-slide.png +0 -0
- package/dist/lib/evg/inspect/shots/state.png +0 -0
- package/dist/lib/evg/inspect/shots.mjs +226 -0
- package/dist/lib/evg/oracle/css-blur.json +576 -0
- package/dist/lib/evg/oracle/css-box.json +157 -0
- package/dist/lib/evg/oracle/css-timing.json +709 -0
- package/dist/lib/evg/oracle/css_blur_oracle.mjs +529 -0
- package/dist/lib/evg/oracle/css_box_oracle.mjs +106 -0
- package/dist/lib/evg/oracle/css_timing_oracle.mjs +389 -0
- package/dist/lib/evg/original/EVGColor.clj +310 -0
- package/dist/lib/evg/original/EVGColorContext.rgr +178 -0
- package/dist/lib/evg/original/SVGPath.rgr +627 -0
- package/dist/lib/evg/original/Vec2.crgr +103 -0
- package/dist/lib/evg/ranger.json +9 -0
- package/dist/lib/evg/showcase/README.md +246 -0
- package/dist/lib/evg/showcase/assets/emblem.svg +30 -0
- package/dist/lib/evg/showcase/assets/rosette.svg +22 -0
- package/dist/lib/evg/showcase/build.mjs +651 -0
- package/dist/lib/evg/showcase/pages/album.tsx +30 -0
- package/dist/lib/evg/showcase/pages/boxmodel.tsx +37 -0
- package/dist/lib/evg/showcase/pages/cards.tsx +41 -0
- package/dist/lib/evg/showcase/pages/chart_api.tsx +170 -0
- package/dist/lib/evg/showcase/pages/charts.tsx +219 -0
- package/dist/lib/evg/showcase/pages/drawing.tsx +160 -0
- package/dist/lib/evg/showcase/pages/emoji.tsx +91 -0
- package/dist/lib/evg/showcase/pages/flex.tsx +46 -0
- package/dist/lib/evg/showcase/pages/more.tsx +332 -0
- package/dist/lib/evg/showcase/pages/plots.tsx +262 -0
- package/dist/lib/evg/showcase/pages/svg.tsx +63 -0
- package/dist/lib/evg/showcase/pages/tables.tsx +209 -0
- package/dist/lib/evg/showcase/pages/typography.tsx +43 -0
- package/dist/lib/evg/showcase/pages/units.tsx +35 -0
- package/dist/lib/evg/showcase/pages/variants.tsx +233 -0
- package/dist/lib/evg/showcase/pages/vector.tsx +75 -0
- package/dist/lib/evg/showcase/pages/views.tsx +223 -0
- package/dist/lib/evg/showcase/tests/chart_api_smoke.mjs +339 -0
- package/dist/lib/evg/showcase/tests/gl_smoke.mjs +125 -0
- package/dist/lib/evg/showcase/themes/chart_api-default.css +15 -0
- package/dist/lib/evg/showcase/themes/charts-default.css +29 -0
- package/dist/lib/evg/showcase/themes/drawing-default.css +35 -0
- package/dist/lib/evg/showcase/themes/more-default.css +128 -0
- package/dist/lib/evg/showcase/themes/plots-default.css +18 -0
- package/dist/lib/evg/showcase/themes/showcase.css +508 -0
- package/dist/lib/evg/showcase/themes/tables-default.css +123 -0
- package/dist/lib/evg/showcase/themes/variants-default.css +15 -0
- package/dist/lib/evg/showcase/themes/views-default.css +15 -0
- package/dist/lib/evg/tools/bench_vs_potrace.mjs +290 -0
- package/dist/lib/evg/tools/evg_image_tool.rgr +488 -0
- package/dist/lib/evg/tools/evg_trace_bench.rgr +114 -0
- package/dist/lib/evg/tools/evg_trace_cli.rgr +662 -0
- package/dist/lib/evg/tools/evg_trace_cpp_bench.rgr +83 -0
- package/dist/lib/evg/tools/run_trace_bench.sh +74 -0
- package/dist/lib/evg/tools/run_trace_cli_smoke.sh +128 -0
- package/dist/lib/evg/web/responsive/EvgResponsiveCheck.rgr +271 -0
- package/dist/lib/evg/web/responsive/EvgResponsiveDemo.rgr +531 -0
- package/dist/lib/evg/web/responsive/README.md +97 -0
- package/dist/lib/evg/web/responsive/build.mjs +90 -0
- package/dist/lib/evg/web/responsive/dom-check.mjs +169 -0
- package/dist/lib/evg/web/responsive/index.html +177 -0
- package/dist/lib/evg/web/responsive/smoke.mjs +221 -0
- package/dist/lib/evg/web/tools/assets-client.mjs +95 -0
- package/dist/lib/evg/web/tools/boot-bench.mjs +189 -0
- package/dist/lib/evg/web/tools/inline-assets.mjs +119 -0
- package/dist/lib/evg/web/tools/minify.mjs +60 -0
- package/dist/lib/evg/web/tracer/build.mjs +87 -0
- package/dist/lib/evg/web/tracer/index.html +2805 -0
- package/dist/lib/evg/web/tracer/sample.png +0 -0
- package/dist/lib/evg/web/tracer/smoke.mjs +1162 -0
- package/dist/lib/evgr/Cargo.lock +21 -0
- package/dist/lib/evgr/Cargo.toml +19 -0
- package/dist/lib/evgr/README.md +140 -0
- package/dist/lib/evgr/bench/NativeBench.rgr +246 -0
- package/dist/lib/evgr/bench/compare.mjs +252 -0
- package/dist/lib/evgr/bench/speed.mjs +277 -0
- package/dist/lib/evgr/bin/.gitignore +3 -0
- package/dist/lib/evgr/src/bin/bench.rs +106 -0
- package/dist/lib/evgr/src/bin/smoke.rs +13 -0
- package/dist/lib/evgr/src/grid.rs +730 -0
- package/dist/lib/evgr/src/lib.rs +1003 -0
- package/dist/lib/evgr/src/style.rs +468 -0
- package/dist/lib/evgr/src/text.rs +83 -0
- package/dist/lib/image/BitReader.rgr +171 -0
- package/dist/lib/image/Buffer.rgr +173 -0
- package/dist/lib/image/DCT.rgr +283 -0
- package/dist/lib/image/Deflate.rgr +339 -0
- package/dist/lib/image/HuffmanDecoder.rgr +181 -0
- package/dist/lib/image/ImageBuffer.rgr +706 -0
- package/dist/lib/image/JPEGDecoder.rgr +808 -0
- package/dist/lib/image/PNGDecoder.rgr +544 -0
- package/dist/lib/image/PNGEncoder.rgr +388 -0
- package/dist/lib/image/PPMImage.rgr +224 -0
- package/dist/lib/image/ProgressiveJPEGDecoder.rgr +1154 -0
- package/dist/lib/image/README.md +33 -0
- package/dist/lib/image/RasterBuffer.rgr +294 -0
- package/dist/lib/image/VP8BoolDecoder.rgr +163 -0
- package/dist/lib/image/WebPDecoder.rgr +433 -0
- package/dist/lib/image/WebPLossless.rgr +1035 -0
- package/dist/lib/image/WebPLossy.rgr +1929 -0
- package/dist/lib/image/ranger.json +9 -0
- package/dist/lib/image/testdata/webp/anim_2f_24x16.webp +0 -0
- package/dist/lib/image/testdata/webp/fixtures.txt +33 -0
- package/dist/lib/image/testdata/webp/gen_fixtures.py +261 -0
- package/dist/lib/image/testdata/webp/ll_1x1.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_alpha_29x21.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_gradient_64x64.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_meta_32x32.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_noise_17x9.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal11_23x11.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal2_19x7.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal40_16x16.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_pal4_13x5.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_photo_40x30.webp +0 -0
- package/dist/lib/image/testdata/webp/ll_predictors_64x32.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_1x1.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f0_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f1_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f2_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_raw_f3_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f0_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f1_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f2_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alph_vp8l_f3_21x13.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_alpha_33x17.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_exif_15x11.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_i16_96x80.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_nofilter_24x20.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_odd_17x9.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_photo_48x40.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_q100_20x18.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_sharp_40x36.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_simple_filter_33x31.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_vpx_parts8_37x45.webp +0 -0
- package/dist/lib/image/testdata/webp/ly_vpx_skip_96x80.webp +0 -0
- package/dist/lib/image/tests/WebPDecodeTool.rgr +81 -0
- package/dist/lib/image/tests/WebPDecoderTest.rgr +1162 -0
- package/dist/lib/image/tests/run_webp_tests.sh +39 -0
- package/dist/lib/rust/RsJson.rgr +468 -0
- package/dist/lib/rust/RsPrelude.rgr +1663 -0
- package/dist/lib/shell_test.rgr +7 -7
- package/dist/lib/stdlib.rgr +21 -5
- package/dist/lib/zip/ranger.json +6 -0
- package/dist/rgrc.js +87318 -67610
- package/package.json +1010 -1040
- package/dist/README.md +0 -117
- package/dist/package.json +0 -47
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
// GENERATED by gallery/vela/tools/vela_evg.rgr — do not edit by hand.
|
|
2
|
+
//
|
|
3
|
+
// Each chart below is an unmodified Vega specification, compiled from a
|
|
4
|
+
// Vega-Lite example, run through the Vela runtime and drawn with the EVG
|
|
5
|
+
// vector layer: every gridline, bar, wedge and label is path data and text
|
|
6
|
+
// this repository computed, in all three targets.
|
|
7
|
+
//
|
|
8
|
+
// Regenerate with: npm run vela:showcase
|
|
9
|
+
|
|
10
|
+
import { View, Label, Path } from "./evg_types";
|
|
11
|
+
|
|
12
|
+
function render() {
|
|
13
|
+
return (
|
|
14
|
+
<View className="page">
|
|
15
|
+
<Label className="title">Näkymät</Label>
|
|
16
|
+
<View className="rule" />
|
|
17
|
+
<View className="row chartRow">
|
|
18
|
+
<View className="chartCell">
|
|
19
|
+
<View className="chartBox">
|
|
20
|
+
<View className="chart" position="relative" width="236px" height="155px">
|
|
21
|
+
<Label className="chartText0" position="absolute" left="134.425px" top="5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">g</Label>
|
|
22
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" d="M51.5,119.5 L46.5,119.5 M51.5,88.5 L46.5,88.5 M51.5,57.5 L46.5,57.5" />
|
|
23
|
+
<Label className="chartLabel" position="absolute" left="31.875px" top="114.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
24
|
+
<Label className="chartLabel" position="absolute" left="25.25px" top="83.5px" width="19.25px" textAlign="right" fontSize="10px">50</Label>
|
|
25
|
+
<Label className="chartLabel" position="absolute" left="18.625px" top="52.5px" width="25.875px" textAlign="right" fontSize="10px">100</Label>
|
|
26
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" d="M51.5,119.5 L51.5,57.5" />
|
|
27
|
+
<Label className="chartTitle" position="absolute" left="3.325px" top="81.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
28
|
+
<Label className="chartText0" position="absolute" left="84.75px" top="36px" width="12.5px" textAlign="center" fontSize="10px">x</Label>
|
|
29
|
+
<Label className="chartText0" position="absolute" left="184.75px" top="36px" width="12.5px" textAlign="center" fontSize="10px">y</Label>
|
|
30
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" d="M56.5,120.5 L56.5,125.5 M65.5,120.5 L65.5,125.5 M73.5,120.5 L73.5,125.5 M82.5,120.5 L82.5,125.5 M91.5,120.5 L91.5,125.5 M99.5,120.5 L99.5,125.5 M108.5,120.5 L108.5,125.5 M117.5,120.5 L117.5,125.5 M125.5,120.5 L125.5,125.5" />
|
|
31
|
+
<Label className="chartLabel" position="absolute" left="49.271px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">A</Label>
|
|
32
|
+
<Label className="chartLabel" position="absolute" left="57.938px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">B</Label>
|
|
33
|
+
<Label className="chartLabel" position="absolute" left="66.604px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">C</Label>
|
|
34
|
+
<Label className="chartLabel" position="absolute" left="75.271px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">D</Label>
|
|
35
|
+
<Label className="chartLabel" position="absolute" left="83.938px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">E</Label>
|
|
36
|
+
<Label className="chartLabel" position="absolute" left="92.604px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">F</Label>
|
|
37
|
+
<Label className="chartLabel" position="absolute" left="101.271px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">G</Label>
|
|
38
|
+
<Label className="chartLabel" position="absolute" left="109.938px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">H</Label>
|
|
39
|
+
<Label className="chartLabel" position="absolute" left="118.604px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">I</Label>
|
|
40
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" d="M52.5,120.5 L130.5,120.5" />
|
|
41
|
+
<Label className="chartTitle" position="absolute" left="84.925px" top="139.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">a</Label>
|
|
42
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" d="M156.5,120.5 L156.5,125.5 M165.5,120.5 L165.5,125.5 M173.5,120.5 L173.5,125.5 M182.5,120.5 L182.5,125.5 M191.5,120.5 L191.5,125.5 M199.5,120.5 L199.5,125.5 M208.5,120.5 L208.5,125.5 M217.5,120.5 L217.5,125.5 M225.5,120.5 L225.5,125.5" />
|
|
43
|
+
<Label className="chartLabel" position="absolute" left="149.271px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">A</Label>
|
|
44
|
+
<Label className="chartLabel" position="absolute" left="157.938px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">B</Label>
|
|
45
|
+
<Label className="chartLabel" position="absolute" left="166.604px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">C</Label>
|
|
46
|
+
<Label className="chartLabel" position="absolute" left="175.271px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">D</Label>
|
|
47
|
+
<Label className="chartLabel" position="absolute" left="183.938px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">E</Label>
|
|
48
|
+
<Label className="chartLabel" position="absolute" left="192.604px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">F</Label>
|
|
49
|
+
<Label className="chartLabel" position="absolute" left="201.271px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">G</Label>
|
|
50
|
+
<Label className="chartLabel" position="absolute" left="209.938px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">H</Label>
|
|
51
|
+
<Label className="chartLabel" position="absolute" left="218.604px" top="121.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">I</Label>
|
|
52
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" d="M152.5,120.5 L230.5,120.5" />
|
|
53
|
+
<Label className="chartTitle" position="absolute" left="184.925px" top="139.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">a</Label>
|
|
54
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" opacity="0.4" d="M52.5,57.5 L130.5,57.5 L130.5,119.5 L52.5,119.5 Z" />
|
|
55
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" opacity="0.25" d="M52.5,119.5 L130.5,119.5 M52.5,88.5 L130.5,88.5 M52.5,57.5 L130.5,57.5" />
|
|
56
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" stroke="none" d="M52.4333,101.64 L60.2333,101.64 L60.2333,119 L52.4333,119 Z M69.7667,92.34 L77.5667,92.34 L77.5667,119 L69.7667,119 Z M87.1,68.78 L94.9,68.78 L94.9,119 L87.1,119 Z M104.4333,107.22 L112.2333,107.22 L112.2333,119 L104.4333,119 Z M121.7667,86.76 L129.5667,86.76 L129.5667,119 L121.7667,119 Z" />
|
|
57
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" opacity="0.4" d="M152.5,57.5 L230.5,57.5 L230.5,119.5 L152.5,119.5 Z" />
|
|
58
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" fill="none" strokeWidth="1" opacity="0.25" d="M152.5,119.5 L230.5,119.5 M152.5,88.5 L230.5,88.5 M152.5,57.5 L230.5,57.5" />
|
|
59
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="236px" height="155px" viewBox="0 0 236 155" stroke="none" d="M161.1,84.9 L168.9,84.9 L168.9,119 L161.1,119 Z M178.4333,62.58 L186.2333,62.58 L186.2333,119 L178.4333,119 Z M195.7667,86.14 L203.5667,86.14 L203.5667,119 L195.7667,119 Z M213.1,65.06 L220.9,65.06 L220.9,119 L213.1,119 Z" />
|
|
60
|
+
</View>
|
|
61
|
+
</View>
|
|
62
|
+
<Label className="caption">Sarakefasetointi · 102 komentoa</Label>
|
|
63
|
+
</View>
|
|
64
|
+
<View className="chartCell">
|
|
65
|
+
<View className="chartBox">
|
|
66
|
+
<View className="chart" position="relative" width="187px" height="156px">
|
|
67
|
+
<Label className="chartText0" position="absolute" left="5.025px" top="58.4px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">g</Label>
|
|
68
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" d="M102.5,54.5 L97.5,54.5 M102.5,32.5 L97.5,32.5 M102.5,10.5 L97.5,10.5" />
|
|
69
|
+
<Label className="chartLabel" position="absolute" left="82.875px" top="49.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
70
|
+
<Label className="chartLabel" position="absolute" left="76.25px" top="27.5px" width="19.25px" textAlign="right" fontSize="10px">50</Label>
|
|
71
|
+
<Label className="chartLabel" position="absolute" left="69.625px" top="5.5px" width="25.875px" textAlign="right" fontSize="10px">100</Label>
|
|
72
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" d="M102.5,54.5 L102.5,10.5" />
|
|
73
|
+
<Label className="chartTitle" position="absolute" left="54.325px" top="25.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
74
|
+
<Label className="chartText0" position="absolute" left="35.75px" top="26px" width="12.5px" textAlign="center" fontSize="10px" rotate="-90">x</Label>
|
|
75
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" d="M102.5,120.5 L97.5,120.5 M102.5,98.5 L97.5,98.5 M102.5,76.5 L97.5,76.5" />
|
|
76
|
+
<Label className="chartLabel" position="absolute" left="82.875px" top="115.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
77
|
+
<Label className="chartLabel" position="absolute" left="76.25px" top="93.5px" width="19.25px" textAlign="right" fontSize="10px">50</Label>
|
|
78
|
+
<Label className="chartLabel" position="absolute" left="69.625px" top="71.5px" width="25.875px" textAlign="right" fontSize="10px">100</Label>
|
|
79
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" d="M102.5,120.5 L102.5,76.5" />
|
|
80
|
+
<Label className="chartTitle" position="absolute" left="54.325px" top="91.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
81
|
+
<Label className="chartText0" position="absolute" left="35.75px" top="92px" width="12.5px" textAlign="center" fontSize="10px" rotate="-90">y</Label>
|
|
82
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" d="M107.5,121.5 L107.5,126.5 M116.5,121.5 L116.5,126.5 M124.5,121.5 L124.5,126.5 M133.5,121.5 L133.5,126.5 M142.5,121.5 L142.5,126.5 M150.5,121.5 L150.5,126.5 M159.5,121.5 L159.5,126.5 M168.5,121.5 L168.5,126.5 M176.5,121.5 L176.5,126.5" />
|
|
83
|
+
<Label className="chartLabel" position="absolute" left="100.271px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">A</Label>
|
|
84
|
+
<Label className="chartLabel" position="absolute" left="108.938px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">B</Label>
|
|
85
|
+
<Label className="chartLabel" position="absolute" left="117.604px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">C</Label>
|
|
86
|
+
<Label className="chartLabel" position="absolute" left="126.271px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">D</Label>
|
|
87
|
+
<Label className="chartLabel" position="absolute" left="134.938px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">E</Label>
|
|
88
|
+
<Label className="chartLabel" position="absolute" left="143.604px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">F</Label>
|
|
89
|
+
<Label className="chartLabel" position="absolute" left="152.271px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">G</Label>
|
|
90
|
+
<Label className="chartLabel" position="absolute" left="160.938px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">H</Label>
|
|
91
|
+
<Label className="chartLabel" position="absolute" left="169.604px" top="122.5px" width="14.125px" textAlign="center" fontSize="10px" rotate="270">I</Label>
|
|
92
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" d="M103.5,121.5 L181.5,121.5" />
|
|
93
|
+
<Label className="chartTitle" position="absolute" left="135.925px" top="140.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">a</Label>
|
|
94
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" opacity="0.4" d="M103.5,10.5 L181.5,10.5 L181.5,54.5 L103.5,54.5 Z" />
|
|
95
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" opacity="0.25" d="M103.5,54.5 L181.5,54.5 M103.5,32.5 L181.5,32.5 M103.5,10.5 L181.5,10.5" />
|
|
96
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" stroke="none" d="M103.4333,41.68 L111.2333,41.68 L111.2333,54 L103.4333,54 Z M120.7667,35.08 L128.5667,35.08 L128.5667,54 L120.7667,54 Z M138.1,18.36 L145.9,18.36 L145.9,54 L138.1,54 Z M155.4333,45.64 L163.2333,45.64 L163.2333,54 L155.4333,54 Z M172.7667,31.12 L180.5667,31.12 L180.5667,54 L172.7667,54 Z" />
|
|
97
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" opacity="0.4" d="M103.5,76.5 L181.5,76.5 L181.5,120.5 L103.5,120.5 Z" />
|
|
98
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" fill="none" strokeWidth="1" opacity="0.25" d="M103.5,120.5 L181.5,120.5 M103.5,98.5 L181.5,98.5 M103.5,76.5 L181.5,76.5" />
|
|
99
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="187px" height="156px" viewBox="0 0 187 156" stroke="none" d="M112.1,95.8 L119.9,95.8 L119.9,120 L112.1,120 Z M129.4333,79.96 L137.2333,79.96 L137.2333,120 L129.4333,120 Z M146.7667,96.68 L154.5667,96.68 L154.5667,120 L146.7667,120 Z M164.1,81.72 L171.9,81.72 L171.9,120 L164.1,120 Z" />
|
|
100
|
+
</View>
|
|
101
|
+
</View>
|
|
102
|
+
<Label className="caption">Rivifasetointi · 86 komentoa</Label>
|
|
103
|
+
</View>
|
|
104
|
+
</View>
|
|
105
|
+
<View className="row chartRow">
|
|
106
|
+
<View className="chartCell">
|
|
107
|
+
<View className="chartBox">
|
|
108
|
+
<View className="chart" position="relative" width="222px" height="263px">
|
|
109
|
+
<Label className="chartText0" position="absolute" left="127.425px" top="5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">a</Label>
|
|
110
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M51.5,79.5 L46.5,79.5 M51.5,47.5 L46.5,47.5" />
|
|
111
|
+
<Label className="chartLabel" position="absolute" left="31.875px" top="74.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
112
|
+
<Label className="chartLabel" position="absolute" left="18.625px" top="42.5px" width="25.875px" textAlign="right" fontSize="10px">100</Label>
|
|
113
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M51.5,79.5 L51.5,47.5" />
|
|
114
|
+
<Label className="chartTitle" position="absolute" left="3.325px" top="56.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
115
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M51.5,153.5 L46.5,153.5 M51.5,121.5 L46.5,121.5" />
|
|
116
|
+
<Label className="chartLabel" position="absolute" left="31.875px" top="148.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
117
|
+
<Label className="chartLabel" position="absolute" left="18.625px" top="116.5px" width="25.875px" textAlign="right" fontSize="10px">100</Label>
|
|
118
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M51.5,153.5 L51.5,121.5" />
|
|
119
|
+
<Label className="chartTitle" position="absolute" left="3.325px" top="130.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
120
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M51.5,227.5 L46.5,227.5 M51.5,195.5 L46.5,195.5" />
|
|
121
|
+
<Label className="chartLabel" position="absolute" left="31.875px" top="222.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
122
|
+
<Label className="chartLabel" position="absolute" left="18.625px" top="190.5px" width="25.875px" textAlign="right" fontSize="10px">100</Label>
|
|
123
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M51.5,227.5 L51.5,195.5" />
|
|
124
|
+
<Label className="chartTitle" position="absolute" left="3.325px" top="204.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
125
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M62.5,228.5 L62.5,233.5 M82.5,228.5 L82.5,233.5" />
|
|
126
|
+
<Label className="chartLabel" position="absolute" left="55.75px" top="229.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">x</Label>
|
|
127
|
+
<Label className="chartLabel" position="absolute" left="75.75px" top="229.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">y</Label>
|
|
128
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M52.5,228.5 L92.5,228.5" />
|
|
129
|
+
<Label className="chartTitle" position="absolute" left="65.925px" top="247.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">g</Label>
|
|
130
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M124.5,228.5 L124.5,233.5 M144.5,228.5 L144.5,233.5" />
|
|
131
|
+
<Label className="chartLabel" position="absolute" left="117.75px" top="229.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">x</Label>
|
|
132
|
+
<Label className="chartLabel" position="absolute" left="137.75px" top="229.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">y</Label>
|
|
133
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M114.5,228.5 L154.5,228.5" />
|
|
134
|
+
<Label className="chartTitle" position="absolute" left="127.925px" top="247.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">g</Label>
|
|
135
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M186.5,228.5 L186.5,233.5 M206.5,228.5 L206.5,233.5" />
|
|
136
|
+
<Label className="chartLabel" position="absolute" left="179.75px" top="229.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">x</Label>
|
|
137
|
+
<Label className="chartLabel" position="absolute" left="199.75px" top="229.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">y</Label>
|
|
138
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" d="M176.5,228.5 L216.5,228.5" />
|
|
139
|
+
<Label className="chartTitle" position="absolute" left="189.925px" top="247.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">g</Label>
|
|
140
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M52.5,47.5 L92.5,47.5 L92.5,79.5 L52.5,79.5 Z" />
|
|
141
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M52.5,79.5 L92.5,79.5 M52.5,47.5 L92.5,47.5" />
|
|
142
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M53,70.04 L71,70.04 L71,79 L53,79 Z" />
|
|
143
|
+
<Label className="chartText0" position="absolute" left="64.938px" top="27px" width="14.125px" textAlign="center" fontSize="10px">A</Label>
|
|
144
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M114.5,47.5 L154.5,47.5 L154.5,79.5 L114.5,79.5 Z" />
|
|
145
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M114.5,79.5 L154.5,79.5 M114.5,47.5 L154.5,47.5" />
|
|
146
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M135,61.4 L153,61.4 L153,79 L135,79 Z" />
|
|
147
|
+
<Label className="chartText0" position="absolute" left="126.938px" top="27px" width="14.125px" textAlign="center" fontSize="10px">B</Label>
|
|
148
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M176.5,47.5 L216.5,47.5 L216.5,79.5 L176.5,79.5 Z" />
|
|
149
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M176.5,79.5 L216.5,79.5 M176.5,47.5 L216.5,47.5" />
|
|
150
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M177,65.24 L195,65.24 L195,79 L177,79 Z" />
|
|
151
|
+
<Label className="chartText0" position="absolute" left="188.938px" top="27px" width="14.125px" textAlign="center" fontSize="10px">C</Label>
|
|
152
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M52.5,121.5 L92.5,121.5 L92.5,153.5 L52.5,153.5 Z" />
|
|
153
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M52.5,153.5 L92.5,153.5 M52.5,121.5 L92.5,121.5" />
|
|
154
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M73,123.88 L91,123.88 L91,153 L73,153 Z" />
|
|
155
|
+
<Label className="chartText0" position="absolute" left="64.938px" top="101px" width="14.125px" textAlign="center" fontSize="10px">D</Label>
|
|
156
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M114.5,121.5 L154.5,121.5 L154.5,153.5 L114.5,153.5 Z" />
|
|
157
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M114.5,153.5 L154.5,153.5 M114.5,121.5 L154.5,121.5" />
|
|
158
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M115,127.08 L133,127.08 L133,153 L115,153 Z" />
|
|
159
|
+
<Label className="chartText0" position="absolute" left="126.938px" top="101px" width="14.125px" textAlign="center" fontSize="10px">E</Label>
|
|
160
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M176.5,121.5 L216.5,121.5 L216.5,153.5 L176.5,153.5 Z" />
|
|
161
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M176.5,153.5 L216.5,153.5 M176.5,121.5 L216.5,121.5" />
|
|
162
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M197,136.04 L215,136.04 L215,153 L197,153 Z" />
|
|
163
|
+
<Label className="chartText0" position="absolute" left="188.938px" top="101px" width="14.125px" textAlign="center" fontSize="10px">F</Label>
|
|
164
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M52.5,195.5 L92.5,195.5 L92.5,227.5 L52.5,227.5 Z" />
|
|
165
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M52.5,227.5 L92.5,227.5 M52.5,195.5 L92.5,195.5" />
|
|
166
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M53,220.92 L71,220.92 L71,227 L53,227 Z" />
|
|
167
|
+
<Label className="chartText0" position="absolute" left="64.938px" top="175px" width="14.125px" textAlign="center" fontSize="10px">G</Label>
|
|
168
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M114.5,195.5 L154.5,195.5 L154.5,227.5 L114.5,227.5 Z" />
|
|
169
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M114.5,227.5 L154.5,227.5 M114.5,195.5 L154.5,195.5" />
|
|
170
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M135,199.16 L153,199.16 L153,227 L135,227 Z" />
|
|
171
|
+
<Label className="chartText0" position="absolute" left="126.938px" top="175px" width="14.125px" textAlign="center" fontSize="10px">H</Label>
|
|
172
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.4" d="M176.5,195.5 L216.5,195.5 L216.5,227.5 L176.5,227.5 Z" />
|
|
173
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" fill="none" strokeWidth="1" opacity="0.25" d="M176.5,227.5 L216.5,227.5 M176.5,195.5 L216.5,195.5" />
|
|
174
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="222px" height="263px" viewBox="0 0 222 263" stroke="none" d="M177,210.36 L195,210.36 L195,227 L177,227 Z" />
|
|
175
|
+
<Label className="chartText0" position="absolute" left="188.938px" top="175px" width="14.125px" textAlign="center" fontSize="10px">I</Label>
|
|
176
|
+
</View>
|
|
177
|
+
</View>
|
|
178
|
+
<Label className="caption">Kääritty ruudukko · 166 komentoa</Label>
|
|
179
|
+
</View>
|
|
180
|
+
<View className="chartCell">
|
|
181
|
+
<View className="chartBox">
|
|
182
|
+
<View className="chart" position="relative" width="257px" height="111px">
|
|
183
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" opacity="0.4" d="M52.5,11.5 L92.5,11.5 L92.5,73.5 L52.5,73.5 Z" />
|
|
184
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" opacity="0.25" d="M52.5,73.5 L92.5,73.5 M52.5,32.5 L92.5,32.5" />
|
|
185
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M62.5,73.5 L62.5,78.5 M82.5,73.5 L82.5,78.5" />
|
|
186
|
+
<Label className="chartLabel" position="absolute" left="55.75px" top="74.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">x</Label>
|
|
187
|
+
<Label className="chartLabel" position="absolute" left="75.75px" top="74.5px" width="12.5px" textAlign="center" fontSize="10px" rotate="270">y</Label>
|
|
188
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M52.5,73.5 L92.5,73.5" />
|
|
189
|
+
<Label className="chartTitle" position="absolute" left="65.925px" top="92.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">g</Label>
|
|
190
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M52.5,73.5 L47.5,73.5 M52.5,32.5 L47.5,32.5" />
|
|
191
|
+
<Label className="chartLabel" position="absolute" left="32.875px" top="68.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
192
|
+
<Label className="chartLabel" position="absolute" left="19.625px" top="27.167px" width="25.875px" textAlign="right" fontSize="10px">200</Label>
|
|
193
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M52.5,73.5 L52.5,11.5" />
|
|
194
|
+
<Label className="chartTitle" position="absolute" left="4.325px" top="35.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
195
|
+
<Path className="chartFill1" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" stroke="none" d="M53,67.2133 L71,67.2133 L71,73 L53,73 Z M73,61.6333 L91,61.6333 L91,73 L73,73 Z M53,58.3267 L71,58.3267 L71,67.2133 L53,67.2133 Z M73,42.8267 L91,42.8267 L91,61.6333 L73,61.6333 Z M53,41.5867 L71,41.5867 L71,58.3267 L53,58.3267 Z M73,31.8733 L91,31.8733 L91,42.8267 L73,42.8267 Z M53,37.66 L71,37.66 L71,41.5867 L53,41.5867 Z M73,13.8933 L91,13.8933 L91,31.8733 L73,31.8733 Z M53,26.9133 L71,26.9133 L71,37.66 L53,37.66 Z" />
|
|
196
|
+
<Path className="chartStroke0" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" opacity="0.4" d="M160.5,11.5 L244.5,11.5 L244.5,73.5 L160.5,73.5 Z" />
|
|
197
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" opacity="0.25" d="M160.5,11.5 L160.5,73.5 M179.5,11.5 L179.5,73.5 M197.5,11.5 L197.5,73.5 M216.5,11.5 L216.5,73.5 M235.5,11.5 L235.5,73.5" />
|
|
198
|
+
<Path className="chartGrid" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" opacity="0.25" d="M160.5,73.5 L244.5,73.5 M160.5,42.5 L244.5,42.5 M160.5,11.5 L244.5,11.5" />
|
|
199
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M160.5,73.5 L160.5,78.5 M179.5,73.5 L179.5,78.5 M197.5,73.5 L197.5,78.5 M216.5,73.5 L216.5,78.5 M235.5,73.5 L235.5,78.5" />
|
|
200
|
+
<Label className="chartLabel" position="absolute" left="160.5px" top="80.5px" width="12.625px" textAlign="left" fontSize="10px">0</Label>
|
|
201
|
+
<Label className="chartLabel" position="absolute" left="172.854px" top="80.5px" width="12.625px" textAlign="center" fontSize="10px">2</Label>
|
|
202
|
+
<Label className="chartLabel" position="absolute" left="191.521px" top="80.5px" width="12.625px" textAlign="center" fontSize="10px">4</Label>
|
|
203
|
+
<Label className="chartLabel" position="absolute" left="210.188px" top="80.5px" width="12.625px" textAlign="center" fontSize="10px">6</Label>
|
|
204
|
+
<Label className="chartLabel" position="absolute" left="228.854px" top="80.5px" width="12.625px" textAlign="center" fontSize="10px">8</Label>
|
|
205
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M160.5,73.5 L244.5,73.5" />
|
|
206
|
+
<Label className="chartTitle" position="absolute" left="195.925px" top="94.5px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold">c</Label>
|
|
207
|
+
<Path className="chartTick" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M160.5,73.5 L155.5,73.5 M160.5,42.5 L155.5,42.5 M160.5,11.5 L155.5,11.5" />
|
|
208
|
+
<Label className="chartLabel" position="absolute" left="140.875px" top="68.5px" width="12.625px" textAlign="right" fontSize="10px">0</Label>
|
|
209
|
+
<Label className="chartLabel" position="absolute" left="134.25px" top="37.5px" width="19.25px" textAlign="right" fontSize="10px">50</Label>
|
|
210
|
+
<Label className="chartLabel" position="absolute" left="127.625px" top="6.5px" width="25.875px" textAlign="right" fontSize="10px">100</Label>
|
|
211
|
+
<Path className="chartDomain" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="1" d="M160.5,73.5 L160.5,11.5" />
|
|
212
|
+
<Label className="chartTitle" position="absolute" left="112.325px" top="35.9px" width="13.15px" textAlign="center" fontSize="11px" fontWeight="bold" rotate="-90">b</Label>
|
|
213
|
+
<Path className="chartStroke1" position="absolute" left="0px" top="0px" width="257px" height="111px" viewBox="0 0 257 111" fill="none" strokeWidth="2" opacity="0.7" d="M209.4053,55.64 C209.4053,57.1525 208.1792,58.3786 206.6667,58.3786 C205.1542,58.3786 203.9281,57.1525 203.9281,55.64 C203.9281,54.1275 205.1542,52.9014 206.6667,52.9014 C208.1792,52.9014 209.4053,54.1275 209.4053,55.64 Z M246.7386,38.9 C246.7386,40.4125 245.5125,41.6386 244,41.6386 C242.4875,41.6386 241.2614,40.4125 241.2614,38.9 C241.2614,37.3875 242.4875,36.1614 244,36.1614 C245.5125,36.1614 246.7386,37.3875 246.7386,38.9 Z M181.4053,46.34 C181.4053,47.8525 180.1792,49.0786 178.6667,49.0786 C177.1542,49.0786 175.9281,47.8525 175.9281,46.34 C175.9281,44.8275 177.1542,43.6014 178.6667,43.6014 C180.1792,43.6014 181.4053,44.8275 181.4053,46.34 Z M228.0719,16.58 C228.0719,18.0925 226.8458,19.3186 225.3333,19.3186 C223.8208,19.3186 222.5947,18.0925 222.5947,16.58 C222.5947,15.0675 223.8208,13.8414 225.3333,13.8414 C226.8458,13.8414 228.0719,15.0675 228.0719,16.58 Z M200.0719,22.78 C200.0719,24.2925 198.8458,25.5186 197.3333,25.5186 C195.8208,25.5186 194.5947,24.2925 194.5947,22.78 C194.5947,21.2675 195.8208,20.0414 197.3333,20.0414 C198.8458,20.0414 200.0719,21.2675 200.0719,22.78 Z M218.7386,40.14 C218.7386,41.6525 217.5125,42.8786 216,42.8786 C214.4875,42.8786 213.2614,41.6525 213.2614,40.14 C213.2614,38.6275 214.4875,37.4014 216,37.4014 C217.5125,37.4014 218.7386,38.6275 218.7386,40.14 Z M237.4053,61.22 C237.4053,62.7325 236.1792,63.9586 234.6667,63.9586 C233.1542,63.9586 231.9281,62.7325 231.9281,61.22 C231.9281,59.7075 233.1542,58.4814 234.6667,58.4814 C236.1792,58.4814 237.4053,59.7075 237.4053,61.22 Z M172.0719,19.06 C172.0719,20.5725 170.8458,21.7986 169.3333,21.7986 C167.8208,21.7986 166.5947,20.5725 166.5947,19.06 C166.5947,17.5475 167.8208,16.3214 169.3333,16.3214 C170.8458,16.3214 172.0719,17.5475 172.0719,19.06 Z M190.7386,40.76 C190.7386,42.2725 189.5125,43.4986 188,43.4986 C186.4875,43.4986 185.2614,42.2725 185.2614,40.76 C185.2614,39.2475 186.4875,38.0214 188,38.0214 C189.5125,38.0214 190.7386,39.2475 190.7386,40.76 Z" />
|
|
214
|
+
</View>
|
|
215
|
+
</View>
|
|
216
|
+
<Label className="caption">Konkatenaatio · 82 komentoa</Label>
|
|
217
|
+
</View>
|
|
218
|
+
</View>
|
|
219
|
+
</View>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export default render;
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* chart_api_smoke.mjs — does the chart API actually RUN in a browser?
|
|
3
|
+
*
|
|
4
|
+
* npm run showcase && npm run showcase:api
|
|
5
|
+
*
|
|
6
|
+
* The rest of this gallery is rendered ahead of time: a PDF and a PNG prove
|
|
7
|
+
* that the API built a chart once, on a build machine, in Node. They do not
|
|
8
|
+
* prove that the compiled API runs where a reader is. This does — it opens
|
|
9
|
+
* `dist/chart-api/` in a real browser and checks, through the page rather than
|
|
10
|
+
* around it:
|
|
11
|
+
*
|
|
12
|
+
* 1. the default script — JavaScript — draws an SVG with real geometry,
|
|
13
|
+
* 2. every preset draws a DIFFERENT chart, and the status line reports the
|
|
14
|
+
* calls that were dispatched and the commands the runtime produced,
|
|
15
|
+
* 3. the SAME chart written in Ranger draws the SAME SVG, byte for byte,
|
|
16
|
+
* which is the claim the two-language page makes,
|
|
17
|
+
* 4. a method the API does not have is refused BY NAME in both languages,
|
|
18
|
+
* 5. editing the DATA redraws the chart — which is what tells a live page
|
|
19
|
+
* from a picture of one,
|
|
20
|
+
* 6. the Vega-Lite the calls built is on the page beside the drawing,
|
|
21
|
+
* 7. and nothing threw: a page error or a console error fails the run.
|
|
22
|
+
*/
|
|
23
|
+
import fs from "node:fs";
|
|
24
|
+
import path from "node:path";
|
|
25
|
+
import http from "node:http";
|
|
26
|
+
import { fileURLToPath } from "node:url";
|
|
27
|
+
import { createRequire } from "node:module";
|
|
28
|
+
|
|
29
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
30
|
+
const ROOT = path.resolve(HERE, "../../../..");
|
|
31
|
+
const DIST = path.resolve(process.argv[2] || path.join(HERE, "..", "dist"));
|
|
32
|
+
const LIVE = path.join(DIST, "chart-api");
|
|
33
|
+
|
|
34
|
+
function loadPlaywright() {
|
|
35
|
+
const anchors = [
|
|
36
|
+
"/opt/node22/lib/node_modules/x",
|
|
37
|
+
path.join(ROOT, "package.json"),
|
|
38
|
+
path.join(process.cwd(), "package.json"),
|
|
39
|
+
import.meta.url,
|
|
40
|
+
];
|
|
41
|
+
for (const anchor of anchors) {
|
|
42
|
+
for (const name of ["playwright", "playwright-core"]) {
|
|
43
|
+
try {
|
|
44
|
+
return createRequire(anchor)(name);
|
|
45
|
+
} catch { /* try the next anchor */ }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function findChrome() {
|
|
52
|
+
const fixed = [process.env.CHROME_PATH, "/usr/bin/chromium", "/usr/bin/google-chrome",
|
|
53
|
+
"/usr/local/bin/google-chrome"].filter(Boolean);
|
|
54
|
+
for (const c of fixed) if (fs.existsSync(c)) return c;
|
|
55
|
+
const pwBrowsers = "/opt/pw-browsers";
|
|
56
|
+
if (fs.existsSync(pwBrowsers)) {
|
|
57
|
+
for (const dir of fs.readdirSync(pwBrowsers)) {
|
|
58
|
+
for (const rel of ["chrome-linux/chrome", "chrome"]) {
|
|
59
|
+
const c = path.join(pwBrowsers, dir, rel);
|
|
60
|
+
if (fs.existsSync(c)) return c;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const pw = loadPlaywright();
|
|
68
|
+
if (!pw) {
|
|
69
|
+
console.log("Playwright is not available — the live page was not checked.");
|
|
70
|
+
process.exit(0);
|
|
71
|
+
}
|
|
72
|
+
if (!fs.existsSync(path.join(LIVE, "index.html"))) {
|
|
73
|
+
console.error(`no live page in ${path.relative(ROOT, LIVE)} — run: npm run showcase`);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const TYPES = { ".html": "text/html", ".js": "text/javascript", ".json": "application/json" };
|
|
78
|
+
const server = http.createServer((req, res) => {
|
|
79
|
+
let file = path.join(DIST, decodeURIComponent(req.url.split("?")[0]));
|
|
80
|
+
if (fs.existsSync(file) && fs.statSync(file).isDirectory()) file = path.join(file, "index.html");
|
|
81
|
+
if (!file.startsWith(DIST) || !fs.existsSync(file)) {
|
|
82
|
+
res.writeHead(404);
|
|
83
|
+
res.end();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
res.writeHead(200, { "content-type": TYPES[path.extname(file)] || "application/octet-stream" });
|
|
87
|
+
fs.createReadStream(file).pipe(res);
|
|
88
|
+
});
|
|
89
|
+
await new Promise((r) => server.listen(0, "127.0.0.1", r));
|
|
90
|
+
const port = server.address().port;
|
|
91
|
+
|
|
92
|
+
const browser = await pw.chromium.launch({
|
|
93
|
+
executablePath: findChrome() || undefined,
|
|
94
|
+
});
|
|
95
|
+
const page = await browser.newPage({ viewport: { width: 1200, height: 900 } });
|
|
96
|
+
const problems = [];
|
|
97
|
+
page.on("pageerror", (e) => problems.push(`page error: ${e}`));
|
|
98
|
+
page.on("console", (m) => {
|
|
99
|
+
if (m.type() !== "error") return;
|
|
100
|
+
const where = (m.location() && m.location().url) || "";
|
|
101
|
+
if (/\/favicon\.ico$/.test(where)) return;
|
|
102
|
+
problems.push(`console: ${m.text()}`);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const checks = [];
|
|
106
|
+
function check(name, ok, detail = "") {
|
|
107
|
+
checks.push({ name, ok, detail });
|
|
108
|
+
console.log(`${ok ? " ok " : " FAIL "} ${name}${detail ? " " + detail : ""}`);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
await page.goto(`http://127.0.0.1:${port}/chart-api/`, { waitUntil: "load" });
|
|
112
|
+
await page.waitForFunction(() => document.querySelector("#chart svg") !== null, null, { timeout: 15000 });
|
|
113
|
+
|
|
114
|
+
const startsIn = await page.evaluate(() =>
|
|
115
|
+
document.querySelector('[data-lang="js"]').getAttribute("aria-pressed"));
|
|
116
|
+
check("the page opens in JavaScript", startsIn === "true", `aria-pressed=${startsIn}`);
|
|
117
|
+
|
|
118
|
+
const first = await page.evaluate(() => ({
|
|
119
|
+
paths: document.querySelectorAll("#chart svg path").length,
|
|
120
|
+
texts: document.querySelectorAll("#chart svg text").length,
|
|
121
|
+
status: document.getElementById("status").textContent,
|
|
122
|
+
svg: document.getElementById("chart").innerHTML.length,
|
|
123
|
+
}));
|
|
124
|
+
check("the default script draws", first.paths >= 2 && first.texts >= 3,
|
|
125
|
+
`${first.paths} paths, ${first.texts} labels`);
|
|
126
|
+
check("and says what it did", /\d+ kutsua/.test(first.status) && /piirtokomentoa/.test(first.status),
|
|
127
|
+
first.status.trim());
|
|
128
|
+
|
|
129
|
+
// A drawn chart is also a document of sentences. `tools/reference/aria.mjs`
|
|
130
|
+
// holds those against official Vega; this holds them against the BUNDLE, which
|
|
131
|
+
// is the half that can silently go missing — a stale build ships a picture
|
|
132
|
+
// that says nothing and every check above still passes.
|
|
133
|
+
const spoken = await page.evaluate(() => {
|
|
134
|
+
const labelled = [...document.querySelectorAll("#chart svg [aria-label]")];
|
|
135
|
+
return {
|
|
136
|
+
guides: labelled.filter((e) => /axis|legend|title/.test(e.getAttribute("aria-roledescription") || ""))
|
|
137
|
+
.map((e) => e.getAttribute("aria-label")),
|
|
138
|
+
marks: labelled.length,
|
|
139
|
+
hidden: document.querySelectorAll("#chart svg [aria-hidden=\"true\"]").length,
|
|
140
|
+
roles: new Set(labelled.map((e) => e.getAttribute("role"))).size,
|
|
141
|
+
};
|
|
142
|
+
});
|
|
143
|
+
check("the drawing says something to a screen reader",
|
|
144
|
+
spoken.guides.some((t) => /-axis titled/.test(t)) && spoken.marks > spoken.guides.length,
|
|
145
|
+
`${spoken.guides.length} guides, ${spoken.marks} labelled elements, ${spoken.hidden} hidden`);
|
|
146
|
+
check("and every labelled element claims a role", spoken.roles === 1,
|
|
147
|
+
spoken.guides[0] || "no guide sentence");
|
|
148
|
+
|
|
149
|
+
// Every preset is a different chart, drawn by the same compiled API.
|
|
150
|
+
const presets = await page.$$eval("[data-preset]", (els) => els.map((e) => e.dataset.preset));
|
|
151
|
+
const shapes = new Map();
|
|
152
|
+
for (const preset of presets) {
|
|
153
|
+
await page.click(`[data-preset="${preset}"]`);
|
|
154
|
+
await page.waitForTimeout(120);
|
|
155
|
+
const drawn = await page.evaluate(() => ({
|
|
156
|
+
svg: document.querySelector("#chart svg")?.outerHTML || "",
|
|
157
|
+
status: document.getElementById("status").textContent,
|
|
158
|
+
bad: document.getElementById("status").className === "bad",
|
|
159
|
+
}));
|
|
160
|
+
check(`preset ${preset} draws`, drawn.svg.length > 500 && !drawn.bad, drawn.status.trim());
|
|
161
|
+
shapes.set(preset, drawn.svg);
|
|
162
|
+
}
|
|
163
|
+
check("the presets are not the same picture", new Set(shapes.values()).size === presets.length,
|
|
164
|
+
`${new Set(shapes.values()).size} of ${presets.length} distinct`);
|
|
165
|
+
|
|
166
|
+
// The same charts in Ranger: the other language, the same engine, and the
|
|
167
|
+
// claim the page makes is that they draw the same picture.
|
|
168
|
+
await page.click('[data-lang="rgr"]');
|
|
169
|
+
await page.waitForTimeout(200);
|
|
170
|
+
let identical = 0;
|
|
171
|
+
for (const name of presets) {
|
|
172
|
+
await page.click(`[data-preset="${name}"]`);
|
|
173
|
+
await page.waitForTimeout(150);
|
|
174
|
+
const drawn = await page.evaluate(() => ({
|
|
175
|
+
svg: document.querySelector("#chart svg")?.outerHTML || "",
|
|
176
|
+
bad: document.getElementById("status").className === "bad",
|
|
177
|
+
code: document.getElementById("code").value,
|
|
178
|
+
}));
|
|
179
|
+
const same = drawn.svg === shapes.get(name);
|
|
180
|
+
if (same) identical += 1;
|
|
181
|
+
if (!same || drawn.bad) {
|
|
182
|
+
check(`preset ${name} in Ranger draws what JavaScript drew`, false,
|
|
183
|
+
drawn.bad ? drawn.code.split("\n")[0] : "different picture");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
check("every preset draws the same picture in both languages", identical === presets.length,
|
|
187
|
+
`${identical} of ${presets.length}`);
|
|
188
|
+
check("and the Ranger source is not the JavaScript",
|
|
189
|
+
!(await page.evaluate(() => document.getElementById("code").value)).includes(";"),
|
|
190
|
+
"no semicolons in the Ranger form");
|
|
191
|
+
|
|
192
|
+
// A method the API does not have is refused by name — in Ranger by the
|
|
193
|
+
// interpreter, in JavaScript by JavaScript itself.
|
|
194
|
+
await page.fill("#code", 'chart.size(200 150)\nchart.colour("region")');
|
|
195
|
+
await page.waitForTimeout(300);
|
|
196
|
+
const refused = await page.evaluate(() => ({
|
|
197
|
+
bad: document.getElementById("status").className === "bad",
|
|
198
|
+
text: document.getElementById("status").textContent,
|
|
199
|
+
}));
|
|
200
|
+
check("an unknown method is refused by name (Ranger)", refused.bad && /no method 'colour'/.test(refused.text),
|
|
201
|
+
refused.text.trim());
|
|
202
|
+
|
|
203
|
+
await page.click('[data-lang="js"]');
|
|
204
|
+
await page.waitForTimeout(150);
|
|
205
|
+
await page.fill("#code", 'chart.size(200, 150);\nchart.colour("region");');
|
|
206
|
+
await page.waitForTimeout(300);
|
|
207
|
+
const refusedJs = await page.evaluate(() => ({
|
|
208
|
+
bad: document.getElementById("status").className === "bad",
|
|
209
|
+
text: document.getElementById("status").textContent,
|
|
210
|
+
}));
|
|
211
|
+
check("and in JavaScript", refusedJs.bad && /colour is not a function/.test(refusedJs.text),
|
|
212
|
+
refusedJs.text.trim());
|
|
213
|
+
|
|
214
|
+
// A column the data does not have is refused too — the API's own check,
|
|
215
|
+
// running in the browser.
|
|
216
|
+
await page.fill("#code", 'chart.size(200, 150);\nchart.bar().x("region").y("profit");');
|
|
217
|
+
await page.waitForTimeout(300);
|
|
218
|
+
const unknownColumn = await page.evaluate(() => document.getElementById("status").textContent);
|
|
219
|
+
check("an unknown column is refused", /no column called 'profit'/.test(unknownColumn), unknownColumn.trim());
|
|
220
|
+
|
|
221
|
+
// Editing the DATA redraws: this is the difference between a live page and a
|
|
222
|
+
// picture of one.
|
|
223
|
+
await page.fill("#code", 'chart.size(300, 180);\nchart.bar().x("region").keepOrder().y("sales").aggregate("sum");');
|
|
224
|
+
await page.waitForTimeout(300);
|
|
225
|
+
const before = await page.evaluate(() => document.querySelector("#chart svg").outerHTML);
|
|
226
|
+
await page.fill("#data", JSON.stringify([
|
|
227
|
+
{ region: "Yksi", sales: 10 },
|
|
228
|
+
{ region: "Kaksi", sales: 90 },
|
|
229
|
+
{ region: "Kolme", sales: 50 },
|
|
230
|
+
]));
|
|
231
|
+
await page.waitForTimeout(300);
|
|
232
|
+
const after = await page.evaluate(() => ({
|
|
233
|
+
svg: document.querySelector("#chart svg").outerHTML,
|
|
234
|
+
cols: document.getElementById("cols").textContent,
|
|
235
|
+
status: document.getElementById("status").textContent,
|
|
236
|
+
}));
|
|
237
|
+
check("editing the data redraws the chart", after.svg !== before && after.svg.includes("Kaksi"),
|
|
238
|
+
after.status.trim());
|
|
239
|
+
check("and the inferred column types are shown", /region → nominal/.test(after.cols) && /sales → quantitative/.test(after.cols),
|
|
240
|
+
after.cols.trim());
|
|
241
|
+
|
|
242
|
+
// The specification the calls built is on the page.
|
|
243
|
+
await page.click('[data-view="spec"]');
|
|
244
|
+
await page.waitForTimeout(120);
|
|
245
|
+
const spec = await page.evaluate(() => document.getElementById("spec").textContent);
|
|
246
|
+
check("the Vega-Lite the calls built is shown", spec.includes("\"mark\"") && spec.includes("\"encoding\""),
|
|
247
|
+
`${spec.split("\n").length} lines`);
|
|
248
|
+
await page.click('[data-view="vega"]');
|
|
249
|
+
await page.waitForTimeout(120);
|
|
250
|
+
const vega = await page.evaluate(() => document.getElementById("vega").textContent);
|
|
251
|
+
check("and the Vega it compiles to", vega.includes("\"scales\"") && vega.includes("\"marks\""),
|
|
252
|
+
`${vega.split("\n").length} lines`);
|
|
253
|
+
|
|
254
|
+
// Docs pages iframe this page with ?embed=1&view=chart. The full playground
|
|
255
|
+
// still draws on load (checked above). The embed hides the chrome, autoruns
|
|
256
|
+
// a preset, and a parent can post a snippet that is not one of the presets.
|
|
257
|
+
const embedPage = await browser.newPage({ viewport: { width: 800, height: 520 } });
|
|
258
|
+
embedPage.on("pageerror", (e) => problems.push(`embed: ${e}`));
|
|
259
|
+
await embedPage.goto(`http://127.0.0.1:${port}/chart-api/?embed=1&view=chart&preset=bar`,
|
|
260
|
+
{ waitUntil: "load" });
|
|
261
|
+
await embedPage.waitForFunction(() => window.__chartApiReady === true, null, { timeout: 15000 });
|
|
262
|
+
await embedPage.waitForFunction(() => document.querySelector("#chart svg") !== null, null, { timeout: 15000 });
|
|
263
|
+
const embed = await embedPage.evaluate(() => ({
|
|
264
|
+
mode: !!window.__embedMode,
|
|
265
|
+
header: getComputedStyle(document.querySelector("header")).display,
|
|
266
|
+
editor: getComputedStyle(document.querySelector("main > div:first-child")).display,
|
|
267
|
+
paths: document.querySelectorAll("#chart svg path").length,
|
|
268
|
+
}));
|
|
269
|
+
check("embed mode is on", embed.mode);
|
|
270
|
+
check("embed hides the playground chrome", embed.header === "none" && embed.editor === "none");
|
|
271
|
+
check("embed autoruns the requested preset", embed.paths >= 2, `${embed.paths} paths`);
|
|
272
|
+
check("embed hides the chart chrome",
|
|
273
|
+
await embedPage.evaluate(() => getComputedStyle(document.querySelector(".head")).display) === "none");
|
|
274
|
+
await embedPage.close();
|
|
275
|
+
|
|
276
|
+
const waitPage = await browser.newPage({ viewport: { width: 800, height: 520 } });
|
|
277
|
+
waitPage.on("pageerror", (e) => problems.push(`wait: ${e}`));
|
|
278
|
+
await waitPage.goto(`http://127.0.0.1:${port}/chart-api/?embed=1&view=chart&run=0`,
|
|
279
|
+
{ waitUntil: "load" });
|
|
280
|
+
await waitPage.waitForFunction(() => window.__chartApiReady === true, null, { timeout: 15000 });
|
|
281
|
+
const waiting = await waitPage.evaluate(() => ({
|
|
282
|
+
svg: document.querySelector("#chart svg") !== null,
|
|
283
|
+
status: document.getElementById("status").textContent,
|
|
284
|
+
}));
|
|
285
|
+
check("embed with run=0 waits for a parent", !waiting.svg && /waiting/.test(waiting.status),
|
|
286
|
+
waiting.status.trim());
|
|
287
|
+
await waitPage.close();
|
|
288
|
+
|
|
289
|
+
const postedCode = `chart.size(280, 160);
|
|
290
|
+
chart.heading("Posted from parent");
|
|
291
|
+
const bars = chart.bar();
|
|
292
|
+
bars.x("region").keepOrder();
|
|
293
|
+
bars.y("sales").aggregate("sum");`;
|
|
294
|
+
fs.writeFileSync(path.join(LIVE, "embed-host.html"), `<!doctype html>
|
|
295
|
+
<html><body style="margin:0">
|
|
296
|
+
<iframe id="f" src="./index.html?embed=1&view=chart&run=0"
|
|
297
|
+
style="width:100%;height:480px;border:0"></iframe>
|
|
298
|
+
<script>
|
|
299
|
+
const f = document.getElementById("f");
|
|
300
|
+
const code = ${JSON.stringify(postedCode)};
|
|
301
|
+
const send = () => {
|
|
302
|
+
try {
|
|
303
|
+
if (f.contentWindow && f.contentWindow.__chartApiReady) {
|
|
304
|
+
f.contentWindow.postMessage({ type: "vela-embed", view: "chart", lang: "js", code: code }, "*");
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
} catch (e) {}
|
|
308
|
+
return false;
|
|
309
|
+
};
|
|
310
|
+
const t = setInterval(() => { if (send()) clearInterval(t); }, 50);
|
|
311
|
+
f.addEventListener("load", () => { if (send()) clearInterval(t); });
|
|
312
|
+
</script>
|
|
313
|
+
</body></html>`);
|
|
314
|
+
const host = await browser.newPage({ viewport: { width: 800, height: 520 } });
|
|
315
|
+
host.on("pageerror", (e) => problems.push(`host: ${e}`));
|
|
316
|
+
await host.goto(`http://127.0.0.1:${port}/chart-api/embed-host.html`, { waitUntil: "load" });
|
|
317
|
+
await host.waitForFunction(() => {
|
|
318
|
+
const f = document.getElementById("f");
|
|
319
|
+
const doc = f && f.contentDocument;
|
|
320
|
+
return doc && doc.querySelector("#chart svg");
|
|
321
|
+
}, null, { timeout: 20000 });
|
|
322
|
+
const posted = await host.evaluate(() => {
|
|
323
|
+
const doc = document.getElementById("f").contentDocument;
|
|
324
|
+
const status = doc.getElementById("status").textContent;
|
|
325
|
+
const svg = doc.getElementById("chart").innerHTML;
|
|
326
|
+
return { status, drew: /<svg/.test(svg), heading: /Posted from parent/.test(svg) };
|
|
327
|
+
});
|
|
328
|
+
check("a parent can post a snippet into the embed", posted.drew && /kutsua/.test(posted.status));
|
|
329
|
+
check("and the posted heading is in the drawing", posted.heading);
|
|
330
|
+
await host.close();
|
|
331
|
+
|
|
332
|
+
check("nothing threw", problems.length === 0, problems.slice(0, 3).join(" | "));
|
|
333
|
+
|
|
334
|
+
await browser.close();
|
|
335
|
+
server.close();
|
|
336
|
+
|
|
337
|
+
const failed = checks.filter((c) => !c.ok).length;
|
|
338
|
+
console.log(`\n${checks.length - failed}/${checks.length} checks passed in a real browser`);
|
|
339
|
+
process.exit(failed === 0 ? 0 : 1);
|