Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
261240e5de | ||
|
|
6cf7c1ee9a | ||
|
|
58ed6c47bd | ||
|
|
af2f57f958 | ||
|
|
38c11cc36d | ||
|
|
4ed8155a91 | ||
|
|
ea57da4e42 | ||
|
|
81bd4ba337 | ||
|
|
8761d2959d | ||
|
|
962bda2c33 | ||
|
|
a8d3bca5e1 | ||
|
|
bb974b6a3b | ||
|
|
42b1179d5e | ||
|
|
d1054d40cb | ||
|
|
4fbfa33e5b | ||
|
|
d8d4e6c8c9 | ||
|
|
47219442cd | ||
|
|
91c75de45a | ||
|
|
b65eefa5a7 | ||
|
|
3d187805b6 | ||
|
|
c3032563c3 | ||
|
|
19d6db400b | ||
|
|
15fac44bd0 | ||
|
|
a870bff01d |
@@ -0,0 +1,121 @@
|
||||
name: Publish @hanzo/ai
|
||||
|
||||
# Surgical publish of ONLY the @hanzo/ai SDK (pkgs/ai). The desktop apps
|
||||
# (hanzo/zoo/lux) render `<HanzoAI/>` from this package; it must be on npm
|
||||
# for a clean `npm i` to resolve it.
|
||||
#
|
||||
# Triggered only on `release/ai-v*` tags. A version bump alone does NOT
|
||||
# publish — the tag gates the run. Tag scheme:
|
||||
# release/ai-v0.1.1 -> @hanzo/ai@0.1.1
|
||||
#
|
||||
# NPM_TOKEN resolution order (same shape as publish-gui.yml):
|
||||
# 1. KMS via Universal Auth (KMS_CLIENT_ID/SECRET -> short-lived token)
|
||||
# 2. KMS via long-lived HANZO_API_KEY (legacy bootstrap)
|
||||
# 3. Direct repo secret NPM_TOKEN (fallback until KMS is provisioned)
|
||||
#
|
||||
# Idempotent: skips if @hanzo/ai@<version> is already on npm.
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'release/ai-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
confirm:
|
||||
description: 'Type "publish" to publish @hanzo/ai at its current on-disk version'
|
||||
required: true
|
||||
default: ''
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
# A transitive puppeteer dep tries to download Chromium in its postinstall,
|
||||
# which fails on the runner and kills `bun install` (run #7). The publish
|
||||
# never drives a browser, so skip every browser-binary download.
|
||||
env:
|
||||
PUPPETEER_SKIP_DOWNLOAD: '1'
|
||||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: '1'
|
||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
|
||||
PUPPETEER_SKIP_CHROME_DOWNLOAD: '1'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Build, smoke-test, publish @hanzo/ai
|
||||
# Same runner publish-gui.yml uses (the proven-working publish path): the
|
||||
# spark arcd host, platform-native via the Hanzo Platform GitHub App. KMS
|
||||
# (kms.hanzo.ai) is reachable here for the NPM_TOKEN resolution. @hanzo/ai is
|
||||
# arch-independent JS; spark has the RAM the monorepo install needs.
|
||||
runs-on: [self-hosted, linux, arm64]
|
||||
if: github.event_name == 'push' || github.event.inputs.confirm == 'publish'
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
# Shallow: the publish only builds pkgs/ai — it needs no git history.
|
||||
# A full clone (fetch-depth 0) of this monorepo's history OOMs git
|
||||
# index-pack on the runner and fails checkout (runs #5/#6 died here).
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Install
|
||||
uses: ./.github/actions/install
|
||||
|
||||
# Canonical, deterministic KMS auth — the ONE way every hanzo/lux/zoo repo
|
||||
# loads secrets (see hanzoai/universe/.github/actions/kms-action). OIDC-
|
||||
# first: GitHub's id-token proves this repo's identity to KMS, so NOTHING
|
||||
# is stored — only non-secret `vars.*` config. NPM_TOKEN is exported into
|
||||
# the job env at `secret-path`. No repo NPM_TOKEN secret, no client_id/
|
||||
# secret. Set KMS_IDENTITY_ID + KMS_PROJECT_ID once at the org level.
|
||||
- name: Load NPM_TOKEN from Hanzo KMS (OIDC)
|
||||
uses: hanzoai/universe/.github/actions/kms-action@main
|
||||
with:
|
||||
identity-id: ${{ vars.KMS_IDENTITY_ID }}
|
||||
project-id: ${{ vars.KMS_PROJECT_ID }}
|
||||
environment: ${{ vars.KMS_ENVIRONMENT || 'prod' }}
|
||||
secret-path: ${{ vars.KMS_PUBLISH_SECRET_PATH || '/publish' }}
|
||||
export-type: env
|
||||
|
||||
- name: Configure npm registry
|
||||
run: |
|
||||
# NPM_TOKEN is now in the job env (kms-action export-type=env).
|
||||
test -n "${NPM_TOKEN:-}" || { echo "::error::KMS did not yield NPM_TOKEN at the publish path"; exit 1; }
|
||||
echo 'registry=https://registry.npmjs.org/' > ~/.npmrc
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
|
||||
|
||||
- name: Build @hanzo/ai (dist + dist-desktop)
|
||||
# pkgs/ai's own build runs BOTH vite passes: dist/ (web entry,
|
||||
# ai.css) and dist-desktop/ (the <HanzoAI/> desktop bundle the apps
|
||||
# import). Build it explicitly so both trees exist before publish.
|
||||
working-directory: pkgs/ai
|
||||
run: bun run build
|
||||
|
||||
- name: Smoke-test dist trees + exports
|
||||
run: |
|
||||
set -eu
|
||||
cd pkgs/ai
|
||||
test -f dist/index.js || (echo "::error::dist/index.js missing"; exit 1)
|
||||
test -f dist/ai.css || (echo "::error::dist/ai.css missing"; exit 1)
|
||||
test -f dist-desktop/index.js || (echo "::error::dist-desktop/index.js missing"; exit 1)
|
||||
# Every file referenced from the exports map must exist.
|
||||
node -e "
|
||||
const fs=require('fs');
|
||||
const pkg=require('./package.json');
|
||||
const walk=(v)=>{
|
||||
if (typeof v==='string') { if (v.startsWith('./') && !fs.existsSync(v)) { console.error('missing:',v); process.exitCode=1; } }
|
||||
else if (v && typeof v==='object') { for (const k of Object.keys(v)) walk(v[k]); }
|
||||
};
|
||||
walk(pkg.exports||{}); walk(pkg.main); walk(pkg.module); walk(pkg.types);
|
||||
"
|
||||
echo "smoke OK: $(node -p "require('./package.json').name + '@' + require('./package.json').version")"
|
||||
|
||||
- name: Publish @hanzo/ai
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ env.NPM_TOKEN }}
|
||||
working-directory: pkgs/ai
|
||||
run: |
|
||||
set -eu
|
||||
version=$(node -p "require('./package.json').version")
|
||||
if npm view "@hanzo/ai@${version}" version >/dev/null 2>&1; then
|
||||
echo "@hanzo/ai@${version} already on npm - skipping."
|
||||
exit 0
|
||||
fi
|
||||
# pkgs/ai has no workspace:* deps, so a direct publish is clean.
|
||||
npm publish --access public
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
|
||||
import { validateToken } from '@hanzo/iam/auth'
|
||||
import type { IamUser } from '@hanzo/iam'
|
||||
import type { User as IamUser } from '@hanzo/iam'
|
||||
|
||||
const IAM_SERVER_URL =
|
||||
process.env.HANZO_IAM_SERVER_URL ?? 'https://iam.hanzo.ai'
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"@rehookify/datepicker": "^6.6.8",
|
||||
"@sindresorhus/slugify": "^2.2.1",
|
||||
"@hanzo/base": "^0.2.0",
|
||||
"@hanzo/iam": "^0.9.4",
|
||||
"@hanzo/iam": "^0.13.1",
|
||||
"@hanzogui/assert": "workspace:*",
|
||||
"@hanzogui/demos": "workspace:*",
|
||||
"@hanzogui/get-token": "workspace:*",
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Visual-Regression Gate (HIP-0504 §rule 6)
|
||||
|
||||
The design-system unification re-bases `@hanzo/ui` onto `@hanzo/gui` and turns
|
||||
`@luxfi/ui` / `@zooai/ui` into theme overlays. Per HIP-0504, **the rendered
|
||||
output must not change** — only the implementation underneath it. This gate
|
||||
enforces that with pixel-diffed screenshots.
|
||||
|
||||
## How it works
|
||||
|
||||
`visual-regression.test.ts` renders the kitchen-sink component gallery (the
|
||||
substrate showcase) and snapshots each surface, comparing against committed
|
||||
baselines in `tests/__screenshots__/`.
|
||||
|
||||
## The contract
|
||||
|
||||
1. **Capture the baseline on the pre-migration ref** (current `@hanzo/ui` / gui):
|
||||
|
||||
```bash
|
||||
cd apps/kitchen-sink
|
||||
PORT=9000 pnpm exec playwright test visual-regression --update-snapshots
|
||||
git add tests/__screenshots__ && git commit -m "test(visual): baseline before design-system migration"
|
||||
```
|
||||
|
||||
2. **Every migration PR runs the suite unchanged.** Drift beyond
|
||||
`maxDiffPixelRatio` (1%) fails CI. A passing run is the proof that Phase 0/1/2
|
||||
decomplected the code without moving a pixel the user sees.
|
||||
|
||||
## Per-phase application
|
||||
|
||||
- **Phase 0** (`@hanzo/ui` on `@hanzo/gui`): baseline captured on 5.x, asserted
|
||||
after the re-base. The public component surface must match.
|
||||
- **Phase 1** (brand overlays): capture a per-brand baseline (lux/zoo theme) and
|
||||
assert the overlay reproduces it — brand look/feel is also a contract.
|
||||
- **Phase 2** (app adoption): each site's own Playwright suite snapshots its key
|
||||
pages before/after switching to the unified `ui`.
|
||||
|
||||
## Notes
|
||||
|
||||
- Non-animated by design (`animations: 'disabled'`) so baselines are
|
||||
deterministic; the suite runs once with the default driver, not across the
|
||||
animation-driver matrix.
|
||||
- `SURFACES` lists the gallery anchors to snapshot — add anchors as demos grow;
|
||||
`gallery-full` always captures the whole showcase as a backstop.
|
||||
- Baselines are platform-sensitive (font rendering). Capture and assert on the
|
||||
same CI runner image; the canonical capture runs on the `hanzo-build-linux-amd64`
|
||||
pool.
|
||||
@@ -0,0 +1,49 @@
|
||||
import { test, expect } from '@playwright/test'
|
||||
|
||||
/**
|
||||
* Visual-regression gate — HIP-0504 §rule 6.
|
||||
*
|
||||
* Decomplecting the design system (re-basing @hanzo/ui onto @hanzo/gui, then
|
||||
* the brand overlays) MUST NOT change the user-visible pixels. This suite
|
||||
* renders the component gallery and asserts each surface matches a committed
|
||||
* baseline within tolerance.
|
||||
*
|
||||
* Workflow:
|
||||
* 1. On the PRE-migration ref, capture the baseline:
|
||||
* pnpm exec playwright test visual-regression --update-snapshots
|
||||
* Commit the generated __screenshots__/ as the contract.
|
||||
* 2. On every migration PR, run the suite unchanged. Any pixel drift beyond
|
||||
* tolerance fails the gate — the implementation changed, the output did not.
|
||||
*
|
||||
* Non-animated (default project) so snapshots are deterministic; animations are
|
||||
* frozen at capture time. Run once with the default driver, not across drivers.
|
||||
*/
|
||||
|
||||
// Stable, brand-agnostic surfaces of the gallery. Extend as demos gain anchors.
|
||||
const SURFACES = [
|
||||
{ name: 'gallery-full', path: '/' },
|
||||
{ name: 'buttons', path: '/#buttons' },
|
||||
{ name: 'inputs', path: '/#inputs' },
|
||||
{ name: 'cards', path: '/#cards' },
|
||||
{ name: 'dialogs', path: '/#dialogs' },
|
||||
{ name: 'sheets', path: '/#sheets' },
|
||||
{ name: 'typography', path: '/#typography' },
|
||||
]
|
||||
|
||||
// Tolerance: tiny sub-pixel AA differences across runs are allowed; structural
|
||||
// or color drift is not. Keep this tight — the contract is "same look/feel".
|
||||
const SNAPSHOT_OPTS = {
|
||||
animations: 'disabled' as const,
|
||||
maxDiffPixelRatio: 0.01,
|
||||
fullPage: true,
|
||||
}
|
||||
|
||||
for (const surface of SURFACES) {
|
||||
test(`look/feel stable — ${surface.name}`, async ({ page }) => {
|
||||
await page.goto(surface.path)
|
||||
// Let fonts + layout settle so the baseline is deterministic.
|
||||
await page.waitForLoadState('networkidle')
|
||||
await page.evaluate(() => document.fonts.ready)
|
||||
await expect(page).toHaveScreenshot(`${surface.name}.png`, SNAPSHOT_OPTS)
|
||||
})
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"lockfileVersion": 1,
|
||||
"configVersion": 0,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "hanzo-gui",
|
||||
@@ -90,7 +91,7 @@
|
||||
"@docsearch/react": "^3.9.0",
|
||||
"@github/mini-throttle": "^2.1.0",
|
||||
"@hanzo/base": "^0.2.0",
|
||||
"@hanzo/iam": "^0.9.4",
|
||||
"@hanzo/iam": "^0.13.1",
|
||||
"@hanzogui/assert": "workspace:*",
|
||||
"@hanzogui/demos": "workspace:*",
|
||||
"@hanzogui/dev-config": "workspace:*",
|
||||
@@ -512,6 +513,8 @@
|
||||
"zustand": "^5.0.0",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/typography": "^0.5.20",
|
||||
"@tailwindcss/vite": "^4",
|
||||
"@testing-library/react": "^16.3.2",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
@@ -3291,7 +3294,7 @@
|
||||
"name": "@hanzogui/shell",
|
||||
"version": "7.3.0",
|
||||
"peerDependencies": {
|
||||
"@hanzo/iam": "^0.11.0",
|
||||
"@hanzo/iam": "^0.13.1",
|
||||
"react": "*",
|
||||
"react-dom": "*",
|
||||
},
|
||||
@@ -4228,7 +4231,7 @@
|
||||
|
||||
"@hanzo/base": ["@hanzo/base@0.2.0", "", { "dependencies": { "pocketbase": "^0.26.5" }, "peerDependencies": { "react": ">=18.0.0" }, "optionalPeers": ["react"] }, "sha512-JymDJQou0olqik3okyqqNxPs2RGwV3wwqzeaX1IdIYsjPCEvgEkSCMqje6FdsuAmSTc5NgVNO62KJ3lIeHsxcA=="],
|
||||
|
||||
"@hanzo/iam": ["@hanzo/iam@0.9.4", "", { "dependencies": { "jose": "^6.1.0", "passport-oauth2": "^1.8.0" }, "peerDependencies": { "react": ">=17" }, "optionalPeers": ["react"] }, "sha512-IJzjvwZct2TB1PpMaWJvytud/DYLTek14qZ8UBpTjVtFWm/bkgcny46CfmhE7IA8EGKCkV8Fvr4Nu82K6eNqpA=="],
|
||||
"@hanzo/iam": ["@hanzo/iam@0.13.1", "", { "dependencies": { "jose": "^6.1.0", "libphonenumber-js": "^1.13.3", "passport-oauth2": "^1.8.0" }, "peerDependencies": { "react": ">=17" }, "optionalPeers": ["react"] }, "sha512-MAqXY7jL5pcPkaUE0Qb/ePL2WKvk3p6EQDLHGZENj+/gbNKs7e/9qG+nmRlPMFVcwXPk+suzkBAEyIMT2EiJ8w=="],
|
||||
|
||||
"@hanzo_network/brand-config": ["@hanzo_network/brand-config@workspace:pkgs/net-brand-config"],
|
||||
|
||||
@@ -7810,6 +7813,8 @@
|
||||
|
||||
"lib0": ["lib0@0.2.117", "", { "dependencies": { "isomorphic.js": "^0.2.4" }, "bin": { "0serve": "bin/0serve.js", "0gentesthtml": "bin/gentesthtml.js", "0ecdsa-generate-keypair": "bin/0ecdsa-generate-keypair.js" } }, "sha512-DeXj9X5xDCjgKLU/7RR+/HQEVzuuEUiwldwOGsHK/sfAfELGWEyTcf0x+uOvCvK3O2zPmZePXWL85vtia6GyZw=="],
|
||||
|
||||
"libphonenumber-js": ["libphonenumber-js@1.13.7", "", {}, "sha512-rvr3HIMdOgzhz1RFGjftji+wjoAFlzhqCNqJOU/MKTZQ8d9NZxAR/tI+0weDicyoucqVR0U1GCniqHJ0f8aM2A=="],
|
||||
|
||||
"libsodium-sumo": ["libsodium-sumo@0.7.16", "", {}, "sha512-x6atrz2AdXCJg6G709x9W9TTJRI6/0NcL5dD0l5GGVqNE48UJmDsjO4RUWYTeyXXUpg+NXZ2SHECaZnFRYzwGA=="],
|
||||
|
||||
"libsodium-wrappers-sumo": ["libsodium-wrappers-sumo@0.7.16", "", { "dependencies": { "libsodium-sumo": "^0.7.16" } }, "sha512-gR0JEFPeN3831lB9+ogooQk0KH4K5LSMIO5Prd5Q5XYR2wHFtZfPg0eP7t1oJIWq+UIzlU4WVeBxZ97mt28tXw=="],
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = abap;
|
||||
//# sourceMappingURL=abap-JWIRRn3r.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { abap as default };
|
||||
//# sourceMappingURL=abap-jLqQxxX2.js.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { actionscript3 as default };
|
||||
//# sourceMappingURL=actionscript-3-DlEWYj0J.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = actionscript3;
|
||||
//# sourceMappingURL=actionscript-3-WzmEuziQ.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { ada as default };
|
||||
//# sourceMappingURL=ada-CM4MWaMR.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = ada;
|
||||
//# sourceMappingURL=ada-DLEERkKA.cjs.map
|
||||
|
||||
+20
-1982
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -45,3 +45,4 @@ const angularHtml = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.definePropert
|
||||
}, Symbol.toStringTag, { value: 'Module' }));
|
||||
|
||||
export { angular_html as a, angular_template as b, angular_expression as c, angular_let_declaration as d, angular_template_blocks as e, angularHtml as f };
|
||||
//# sourceMappingURL=angular-html-BgNfP_om.js.map
|
||||
|
||||
@@ -52,3 +52,4 @@ exports.angular_html = angular_html;
|
||||
exports.angular_let_declaration = angular_let_declaration;
|
||||
exports.angular_template = angular_template;
|
||||
exports.angular_template_blocks = angular_template_blocks;
|
||||
//# sourceMappingURL=angular-html-dqrS97cI.cjs.map
|
||||
|
||||
@@ -33,3 +33,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = angularTs;
|
||||
//# sourceMappingURL=angular-ts-Bkk9Qpg_.cjs.map
|
||||
|
||||
+1
@@ -29,3 +29,4 @@ lang
|
||||
];
|
||||
|
||||
export { angularTs as default };
|
||||
//# sourceMappingURL=angular-ts-D3jazdSt.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = apache;
|
||||
//# sourceMappingURL=apache-BExgW4NZ.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { apache as default };
|
||||
//# sourceMappingURL=apache-Nn4Ip1oC.js.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { apex as default };
|
||||
//# sourceMappingURL=apex-B2GYCwgv.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = apex;
|
||||
//# sourceMappingURL=apex-tSdhdWyI.cjs.map
|
||||
|
||||
@@ -16,3 +16,4 @@ lang
|
||||
];
|
||||
|
||||
export { apl as default };
|
||||
//# sourceMappingURL=apl-BjdRe4G9.js.map
|
||||
|
||||
@@ -20,3 +20,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = apl;
|
||||
//# sourceMappingURL=apl-D6KHLOEj.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { applescript as default };
|
||||
//# sourceMappingURL=applescript-BaXuR7SY.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = applescript;
|
||||
//# sourceMappingURL=applescript-CG_lOcFh.cjs.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = ara;
|
||||
//# sourceMappingURL=ara--SmoRkRZ.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { ara as default };
|
||||
//# sourceMappingURL=ara-C-ZVG3sN.js.map
|
||||
|
||||
@@ -1,270 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const index = require('./index-BSSKeTjn.cjs');
|
||||
|
||||
function arcInnerRadius(d) {
|
||||
return d.innerRadius;
|
||||
}
|
||||
|
||||
function arcOuterRadius(d) {
|
||||
return d.outerRadius;
|
||||
}
|
||||
|
||||
function arcStartAngle(d) {
|
||||
return d.startAngle;
|
||||
}
|
||||
|
||||
function arcEndAngle(d) {
|
||||
return d.endAngle;
|
||||
}
|
||||
|
||||
function arcPadAngle(d) {
|
||||
return d && d.padAngle; // Note: optional!
|
||||
}
|
||||
|
||||
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
||||
var x10 = x1 - x0, y10 = y1 - y0,
|
||||
x32 = x3 - x2, y32 = y3 - y2,
|
||||
t = y32 * x10 - x32 * y10;
|
||||
if (t * t < index.epsilon) return;
|
||||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
||||
return [x0 + t * x10, y0 + t * y10];
|
||||
}
|
||||
|
||||
// Compute perpendicular offset line of length rc.
|
||||
// http://mathworld.wolfram.com/Circle-LineIntersection.html
|
||||
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
||||
var x01 = x0 - x1,
|
||||
y01 = y0 - y1,
|
||||
lo = (cw ? rc : -rc) / index.sqrt(x01 * x01 + y01 * y01),
|
||||
ox = lo * y01,
|
||||
oy = -lo * x01,
|
||||
x11 = x0 + ox,
|
||||
y11 = y0 + oy,
|
||||
x10 = x1 + ox,
|
||||
y10 = y1 + oy,
|
||||
x00 = (x11 + x10) / 2,
|
||||
y00 = (y11 + y10) / 2,
|
||||
dx = x10 - x11,
|
||||
dy = y10 - y11,
|
||||
d2 = dx * dx + dy * dy,
|
||||
r = r1 - rc,
|
||||
D = x11 * y10 - x10 * y11,
|
||||
d = (dy < 0 ? -1 : 1) * index.sqrt(index.max(0, r * r * d2 - D * D)),
|
||||
cx0 = (D * dy - dx * d) / d2,
|
||||
cy0 = (-D * dx - dy * d) / d2,
|
||||
cx1 = (D * dy + dx * d) / d2,
|
||||
cy1 = (-D * dx + dy * d) / d2,
|
||||
dx0 = cx0 - x00,
|
||||
dy0 = cy0 - y00,
|
||||
dx1 = cx1 - x00,
|
||||
dy1 = cy1 - y00;
|
||||
|
||||
// Pick the closer of the two intersection points.
|
||||
// TODO Is there a faster way to determine which intersection to use?
|
||||
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
||||
|
||||
return {
|
||||
cx: cx0,
|
||||
cy: cy0,
|
||||
x01: -ox,
|
||||
y01: -oy,
|
||||
x11: cx0 * (r1 / r - 1),
|
||||
y11: cy0 * (r1 / r - 1)
|
||||
};
|
||||
}
|
||||
|
||||
function d3arc() {
|
||||
var innerRadius = arcInnerRadius,
|
||||
outerRadius = arcOuterRadius,
|
||||
cornerRadius = index.constant(0),
|
||||
padRadius = null,
|
||||
startAngle = arcStartAngle,
|
||||
endAngle = arcEndAngle,
|
||||
padAngle = arcPadAngle,
|
||||
context = null,
|
||||
path = index.withPath(arc);
|
||||
|
||||
function arc() {
|
||||
var buffer,
|
||||
r,
|
||||
r0 = +innerRadius.apply(this, arguments),
|
||||
r1 = +outerRadius.apply(this, arguments),
|
||||
a0 = startAngle.apply(this, arguments) - index.halfPi,
|
||||
a1 = endAngle.apply(this, arguments) - index.halfPi,
|
||||
da = index.abs(a1 - a0),
|
||||
cw = a1 > a0;
|
||||
|
||||
if (!context) context = buffer = path();
|
||||
|
||||
// Ensure that the outer radius is always larger than the inner radius.
|
||||
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
||||
|
||||
// Is it a point?
|
||||
if (!(r1 > index.epsilon)) context.moveTo(0, 0);
|
||||
|
||||
// Or is it a circle or annulus?
|
||||
else if (da > index.tau - index.epsilon) {
|
||||
context.moveTo(r1 * index.cos(a0), r1 * index.sin(a0));
|
||||
context.arc(0, 0, r1, a0, a1, !cw);
|
||||
if (r0 > index.epsilon) {
|
||||
context.moveTo(r0 * index.cos(a1), r0 * index.sin(a1));
|
||||
context.arc(0, 0, r0, a1, a0, cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is it a circular or annular sector?
|
||||
else {
|
||||
var a01 = a0,
|
||||
a11 = a1,
|
||||
a00 = a0,
|
||||
a10 = a1,
|
||||
da0 = da,
|
||||
da1 = da,
|
||||
ap = padAngle.apply(this, arguments) / 2,
|
||||
rp = (ap > index.epsilon) && (padRadius ? +padRadius.apply(this, arguments) : index.sqrt(r0 * r0 + r1 * r1)),
|
||||
rc = index.min(index.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
|
||||
rc0 = rc,
|
||||
rc1 = rc,
|
||||
t0,
|
||||
t1;
|
||||
|
||||
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
||||
if (rp > index.epsilon) {
|
||||
var p0 = index.asin(rp / r0 * index.sin(ap)),
|
||||
p1 = index.asin(rp / r1 * index.sin(ap));
|
||||
if ((da0 -= p0 * 2) > index.epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
|
||||
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
||||
if ((da1 -= p1 * 2) > index.epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
|
||||
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
||||
}
|
||||
|
||||
var x01 = r1 * index.cos(a01),
|
||||
y01 = r1 * index.sin(a01),
|
||||
x10 = r0 * index.cos(a10),
|
||||
y10 = r0 * index.sin(a10);
|
||||
|
||||
// Apply rounded corners?
|
||||
if (rc > index.epsilon) {
|
||||
var x11 = r1 * index.cos(a11),
|
||||
y11 = r1 * index.sin(a11),
|
||||
x00 = r0 * index.cos(a00),
|
||||
y00 = r0 * index.sin(a00),
|
||||
oc;
|
||||
|
||||
// Restrict the corner radius according to the sector angle. If this
|
||||
// intersection fails, it’s probably because the arc is too small, so
|
||||
// disable the corner radius entirely.
|
||||
if (da < index.pi) {
|
||||
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
|
||||
var ax = x01 - oc[0],
|
||||
ay = y01 - oc[1],
|
||||
bx = x11 - oc[0],
|
||||
by = y11 - oc[1],
|
||||
kc = 1 / index.sin(index.acos((ax * bx + ay * by) / (index.sqrt(ax * ax + ay * ay) * index.sqrt(bx * bx + by * by))) / 2),
|
||||
lc = index.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
||||
rc0 = index.min(rc, (r0 - lc) / (kc - 1));
|
||||
rc1 = index.min(rc, (r1 - lc) / (kc + 1));
|
||||
} else {
|
||||
rc0 = rc1 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Is the sector collapsed to a line?
|
||||
if (!(da1 > index.epsilon)) context.moveTo(x01, y01);
|
||||
|
||||
// Does the sector’s outer ring have rounded corners?
|
||||
else if (rc1 > index.epsilon) {
|
||||
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
||||
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
||||
|
||||
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
||||
|
||||
// Have the corners merged?
|
||||
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, index.atan2(t0.y01, t0.x01), index.atan2(t1.y01, t1.x01), !cw);
|
||||
|
||||
// Otherwise, draw the two corners and the ring.
|
||||
else {
|
||||
context.arc(t0.cx, t0.cy, rc1, index.atan2(t0.y01, t0.x01), index.atan2(t0.y11, t0.x11), !cw);
|
||||
context.arc(0, 0, r1, index.atan2(t0.cy + t0.y11, t0.cx + t0.x11), index.atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
||||
context.arc(t1.cx, t1.cy, rc1, index.atan2(t1.y11, t1.x11), index.atan2(t1.y01, t1.x01), !cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is the outer ring just a circular arc?
|
||||
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
||||
|
||||
// Is there no inner ring, and it’s a circular sector?
|
||||
// Or perhaps it’s an annular sector collapsed due to padding?
|
||||
if (!(r0 > index.epsilon) || !(da0 > index.epsilon)) context.lineTo(x10, y10);
|
||||
|
||||
// Does the sector’s inner ring (or point) have rounded corners?
|
||||
else if (rc0 > index.epsilon) {
|
||||
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
||||
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
||||
|
||||
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
||||
|
||||
// Have the corners merged?
|
||||
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, index.atan2(t0.y01, t0.x01), index.atan2(t1.y01, t1.x01), !cw);
|
||||
|
||||
// Otherwise, draw the two corners and the ring.
|
||||
else {
|
||||
context.arc(t0.cx, t0.cy, rc0, index.atan2(t0.y01, t0.x01), index.atan2(t0.y11, t0.x11), !cw);
|
||||
context.arc(0, 0, r0, index.atan2(t0.cy + t0.y11, t0.cx + t0.x11), index.atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
||||
context.arc(t1.cx, t1.cy, rc0, index.atan2(t1.y11, t1.x11), index.atan2(t1.y01, t1.x01), !cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is the inner ring just a circular arc?
|
||||
else context.arc(0, 0, r0, a10, a00, cw);
|
||||
}
|
||||
|
||||
context.closePath();
|
||||
|
||||
if (buffer) return context = null, buffer + "" || null;
|
||||
}
|
||||
|
||||
arc.centroid = function() {
|
||||
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
|
||||
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - index.pi / 2;
|
||||
return [index.cos(a) * r, index.sin(a) * r];
|
||||
};
|
||||
|
||||
arc.innerRadius = function(_) {
|
||||
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : innerRadius;
|
||||
};
|
||||
|
||||
arc.outerRadius = function(_) {
|
||||
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : outerRadius;
|
||||
};
|
||||
|
||||
arc.cornerRadius = function(_) {
|
||||
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : index.constant(+_), arc) : cornerRadius;
|
||||
};
|
||||
|
||||
arc.padRadius = function(_) {
|
||||
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : index.constant(+_), arc) : padRadius;
|
||||
};
|
||||
|
||||
arc.startAngle = function(_) {
|
||||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : startAngle;
|
||||
};
|
||||
|
||||
arc.endAngle = function(_) {
|
||||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : endAngle;
|
||||
};
|
||||
|
||||
arc.padAngle = function(_) {
|
||||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : index.constant(+_), arc) : padAngle;
|
||||
};
|
||||
|
||||
arc.context = function(_) {
|
||||
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
|
||||
};
|
||||
|
||||
return arc;
|
||||
}
|
||||
|
||||
exports.d3arc = d3arc;
|
||||
@@ -1,268 +0,0 @@
|
||||
import { P as withPath, Q as pi, S as cos, T as sin, V as constant, W as halfPi, X as epsilon, Y as tau, Z as sqrt, $ as min, a0 as abs, a1 as atan2, a2 as max, a3 as asin, a4 as acos } from './index-BnaE_tRw.js';
|
||||
|
||||
function arcInnerRadius(d) {
|
||||
return d.innerRadius;
|
||||
}
|
||||
|
||||
function arcOuterRadius(d) {
|
||||
return d.outerRadius;
|
||||
}
|
||||
|
||||
function arcStartAngle(d) {
|
||||
return d.startAngle;
|
||||
}
|
||||
|
||||
function arcEndAngle(d) {
|
||||
return d.endAngle;
|
||||
}
|
||||
|
||||
function arcPadAngle(d) {
|
||||
return d && d.padAngle; // Note: optional!
|
||||
}
|
||||
|
||||
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
||||
var x10 = x1 - x0, y10 = y1 - y0,
|
||||
x32 = x3 - x2, y32 = y3 - y2,
|
||||
t = y32 * x10 - x32 * y10;
|
||||
if (t * t < epsilon) return;
|
||||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
||||
return [x0 + t * x10, y0 + t * y10];
|
||||
}
|
||||
|
||||
// Compute perpendicular offset line of length rc.
|
||||
// http://mathworld.wolfram.com/Circle-LineIntersection.html
|
||||
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
||||
var x01 = x0 - x1,
|
||||
y01 = y0 - y1,
|
||||
lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),
|
||||
ox = lo * y01,
|
||||
oy = -lo * x01,
|
||||
x11 = x0 + ox,
|
||||
y11 = y0 + oy,
|
||||
x10 = x1 + ox,
|
||||
y10 = y1 + oy,
|
||||
x00 = (x11 + x10) / 2,
|
||||
y00 = (y11 + y10) / 2,
|
||||
dx = x10 - x11,
|
||||
dy = y10 - y11,
|
||||
d2 = dx * dx + dy * dy,
|
||||
r = r1 - rc,
|
||||
D = x11 * y10 - x10 * y11,
|
||||
d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),
|
||||
cx0 = (D * dy - dx * d) / d2,
|
||||
cy0 = (-D * dx - dy * d) / d2,
|
||||
cx1 = (D * dy + dx * d) / d2,
|
||||
cy1 = (-D * dx + dy * d) / d2,
|
||||
dx0 = cx0 - x00,
|
||||
dy0 = cy0 - y00,
|
||||
dx1 = cx1 - x00,
|
||||
dy1 = cy1 - y00;
|
||||
|
||||
// Pick the closer of the two intersection points.
|
||||
// TODO Is there a faster way to determine which intersection to use?
|
||||
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
||||
|
||||
return {
|
||||
cx: cx0,
|
||||
cy: cy0,
|
||||
x01: -ox,
|
||||
y01: -oy,
|
||||
x11: cx0 * (r1 / r - 1),
|
||||
y11: cy0 * (r1 / r - 1)
|
||||
};
|
||||
}
|
||||
|
||||
function d3arc() {
|
||||
var innerRadius = arcInnerRadius,
|
||||
outerRadius = arcOuterRadius,
|
||||
cornerRadius = constant(0),
|
||||
padRadius = null,
|
||||
startAngle = arcStartAngle,
|
||||
endAngle = arcEndAngle,
|
||||
padAngle = arcPadAngle,
|
||||
context = null,
|
||||
path = withPath(arc);
|
||||
|
||||
function arc() {
|
||||
var buffer,
|
||||
r,
|
||||
r0 = +innerRadius.apply(this, arguments),
|
||||
r1 = +outerRadius.apply(this, arguments),
|
||||
a0 = startAngle.apply(this, arguments) - halfPi,
|
||||
a1 = endAngle.apply(this, arguments) - halfPi,
|
||||
da = abs(a1 - a0),
|
||||
cw = a1 > a0;
|
||||
|
||||
if (!context) context = buffer = path();
|
||||
|
||||
// Ensure that the outer radius is always larger than the inner radius.
|
||||
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
||||
|
||||
// Is it a point?
|
||||
if (!(r1 > epsilon)) context.moveTo(0, 0);
|
||||
|
||||
// Or is it a circle or annulus?
|
||||
else if (da > tau - epsilon) {
|
||||
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
||||
context.arc(0, 0, r1, a0, a1, !cw);
|
||||
if (r0 > epsilon) {
|
||||
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
||||
context.arc(0, 0, r0, a1, a0, cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is it a circular or annular sector?
|
||||
else {
|
||||
var a01 = a0,
|
||||
a11 = a1,
|
||||
a00 = a0,
|
||||
a10 = a1,
|
||||
da0 = da,
|
||||
da1 = da,
|
||||
ap = padAngle.apply(this, arguments) / 2,
|
||||
rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
|
||||
rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
|
||||
rc0 = rc,
|
||||
rc1 = rc,
|
||||
t0,
|
||||
t1;
|
||||
|
||||
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
||||
if (rp > epsilon) {
|
||||
var p0 = asin(rp / r0 * sin(ap)),
|
||||
p1 = asin(rp / r1 * sin(ap));
|
||||
if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
|
||||
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
||||
if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
|
||||
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
||||
}
|
||||
|
||||
var x01 = r1 * cos(a01),
|
||||
y01 = r1 * sin(a01),
|
||||
x10 = r0 * cos(a10),
|
||||
y10 = r0 * sin(a10);
|
||||
|
||||
// Apply rounded corners?
|
||||
if (rc > epsilon) {
|
||||
var x11 = r1 * cos(a11),
|
||||
y11 = r1 * sin(a11),
|
||||
x00 = r0 * cos(a00),
|
||||
y00 = r0 * sin(a00),
|
||||
oc;
|
||||
|
||||
// Restrict the corner radius according to the sector angle. If this
|
||||
// intersection fails, it’s probably because the arc is too small, so
|
||||
// disable the corner radius entirely.
|
||||
if (da < pi) {
|
||||
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
|
||||
var ax = x01 - oc[0],
|
||||
ay = y01 - oc[1],
|
||||
bx = x11 - oc[0],
|
||||
by = y11 - oc[1],
|
||||
kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),
|
||||
lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
||||
rc0 = min(rc, (r0 - lc) / (kc - 1));
|
||||
rc1 = min(rc, (r1 - lc) / (kc + 1));
|
||||
} else {
|
||||
rc0 = rc1 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Is the sector collapsed to a line?
|
||||
if (!(da1 > epsilon)) context.moveTo(x01, y01);
|
||||
|
||||
// Does the sector’s outer ring have rounded corners?
|
||||
else if (rc1 > epsilon) {
|
||||
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
||||
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
||||
|
||||
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
||||
|
||||
// Have the corners merged?
|
||||
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
||||
|
||||
// Otherwise, draw the two corners and the ring.
|
||||
else {
|
||||
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
||||
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
||||
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is the outer ring just a circular arc?
|
||||
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
||||
|
||||
// Is there no inner ring, and it’s a circular sector?
|
||||
// Or perhaps it’s an annular sector collapsed due to padding?
|
||||
if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
|
||||
|
||||
// Does the sector’s inner ring (or point) have rounded corners?
|
||||
else if (rc0 > epsilon) {
|
||||
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
||||
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
||||
|
||||
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
||||
|
||||
// Have the corners merged?
|
||||
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
||||
|
||||
// Otherwise, draw the two corners and the ring.
|
||||
else {
|
||||
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
||||
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
||||
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is the inner ring just a circular arc?
|
||||
else context.arc(0, 0, r0, a10, a00, cw);
|
||||
}
|
||||
|
||||
context.closePath();
|
||||
|
||||
if (buffer) return context = null, buffer + "" || null;
|
||||
}
|
||||
|
||||
arc.centroid = function() {
|
||||
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
|
||||
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
||||
return [cos(a) * r, sin(a) * r];
|
||||
};
|
||||
|
||||
arc.innerRadius = function(_) {
|
||||
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
|
||||
};
|
||||
|
||||
arc.outerRadius = function(_) {
|
||||
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
|
||||
};
|
||||
|
||||
arc.cornerRadius = function(_) {
|
||||
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
|
||||
};
|
||||
|
||||
arc.padRadius = function(_) {
|
||||
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
|
||||
};
|
||||
|
||||
arc.startAngle = function(_) {
|
||||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
|
||||
};
|
||||
|
||||
arc.endAngle = function(_) {
|
||||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
|
||||
};
|
||||
|
||||
arc.padAngle = function(_) {
|
||||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
|
||||
};
|
||||
|
||||
arc.context = function(_) {
|
||||
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
|
||||
};
|
||||
|
||||
return arc;
|
||||
}
|
||||
|
||||
export { d3arc as d };
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = asciidoc;
|
||||
//# sourceMappingURL=asciidoc-B9ufXDGE.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { asciidoc as default };
|
||||
//# sourceMappingURL=asciidoc-KdP1ByGr.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = asm;
|
||||
//# sourceMappingURL=asm-C-hkJGdK.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { asm as default };
|
||||
//# sourceMappingURL=asm-iBd6CUQw.js.map
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
var __viteBrowserExternal = {};
|
||||
|
||||
export { __viteBrowserExternal as default };
|
||||
//# sourceMappingURL=__vite-browser-external-C6dvzdW7.js.map
|
||||
|
||||
@@ -304,3 +304,4 @@ self.onmessage = async (event) => {
|
||||
console.warn("Unknown message type:", event.data?.type);
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=python-code-runner-web-worker-srlOnxRn.js.map
|
||||
|
||||
@@ -22,3 +22,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = astro;
|
||||
//# sourceMappingURL=astro-Cp6zZR-b.cjs.map
|
||||
|
||||
@@ -18,3 +18,4 @@ lang
|
||||
];
|
||||
|
||||
export { astro as default };
|
||||
//# sourceMappingURL=astro-DmcoQVlf.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { awk as default };
|
||||
//# sourceMappingURL=awk-3U3DJyke.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = awk;
|
||||
//# sourceMappingURL=awk-9ns3fHZl.cjs.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { ballerina as default };
|
||||
//# sourceMappingURL=ballerina-B9Z_EaNK.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = ballerina;
|
||||
//# sourceMappingURL=ballerina-BpNosGbl.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { bat as default };
|
||||
//# sourceMappingURL=bat-C-jlloPL.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = bat;
|
||||
//# sourceMappingURL=bat-hk_Zbchx.cjs.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = beancount;
|
||||
//# sourceMappingURL=beancount-CSwWhn7e.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { beancount as default };
|
||||
//# sourceMappingURL=beancount-D5Viq-xB.js.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { berry as default };
|
||||
//# sourceMappingURL=berry-Cl4ZUvQZ.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = berry;
|
||||
//# sourceMappingURL=berry-Cpid5Afm.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { bibtex as default };
|
||||
//# sourceMappingURL=bibtex-B71tYhgb.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = bibtex;
|
||||
//# sourceMappingURL=bibtex-DxxwiVlR.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { bicep as default };
|
||||
//# sourceMappingURL=bicep-BkgsnHK9.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = bicep;
|
||||
//# sourceMappingURL=bicep-DOMMBXyq.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { bird2 as default };
|
||||
//# sourceMappingURL=bird2-DRq8VoZF.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = bird2;
|
||||
//# sourceMappingURL=bird2-m9gx0Z9A.cjs.map
|
||||
|
||||
@@ -24,3 +24,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = blade;
|
||||
//# sourceMappingURL=blade-D9yuKlnZ.cjs.map
|
||||
|
||||
@@ -20,3 +20,4 @@ lang
|
||||
];
|
||||
|
||||
export { blade as default };
|
||||
//# sourceMappingURL=blade-ckr0bDBv.js.map
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -12,3 +12,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = bsl;
|
||||
//# sourceMappingURL=bsl-BKFU8dp_.cjs.map
|
||||
|
||||
@@ -8,3 +8,4 @@ lang
|
||||
];
|
||||
|
||||
export { bsl as default };
|
||||
//# sourceMappingURL=bsl-DZeIKWc1.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = c;
|
||||
//# sourceMappingURL=c-CehLjwsu.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { c as default };
|
||||
//# sourceMappingURL=c-Dnm0DNxM.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = c3;
|
||||
//# sourceMappingURL=c3-CS2oDaUT.cjs.map
|
||||
|
||||
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { c3 as default };
|
||||
//# sourceMappingURL=c3-b29dgbgu.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,3 +5,4 @@ lang
|
||||
];
|
||||
|
||||
export { cadence as default };
|
||||
//# sourceMappingURL=cadence-CsQXjOho.js.map
|
||||
|
||||
@@ -9,3 +9,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = cadence;
|
||||
//# sourceMappingURL=cadence-Kq9Mah6f.cjs.map
|
||||
|
||||
@@ -12,3 +12,4 @@ lang
|
||||
];
|
||||
|
||||
exports.default = cairo;
|
||||
//# sourceMappingURL=cairo-ByTavjMT.cjs.map
|
||||
|
||||
@@ -8,3 +8,4 @@ lang
|
||||
];
|
||||
|
||||
export { cairo as default };
|
||||
//# sourceMappingURL=cairo-DzY2jMqW.js.map
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,9 +0,0 @@
|
||||
import { U as Utils, F as Color } from './index-BnaE_tRw.js';
|
||||
|
||||
/* IMPORT */
|
||||
/* MAIN */
|
||||
const channel = (color, channel) => {
|
||||
return Utils.lang.round(Color.parse(color)[channel]);
|
||||
};
|
||||
|
||||
export { channel as c };
|
||||
@@ -1,11 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const index = require('./index-BSSKeTjn.cjs');
|
||||
|
||||
/* IMPORT */
|
||||
/* MAIN */
|
||||
const channel = (color, channel) => {
|
||||
return index.Utils.lang.round(index.Color.parse(color)[channel]);
|
||||
};
|
||||
|
||||
exports.channel = channel;
|
||||
@@ -1,25 +0,0 @@
|
||||
import { _ as __name, e as configureSvgSize, l as log } from './index-BnaE_tRw.js';
|
||||
|
||||
// src/rendering-util/setupViewPortForSVG.ts
|
||||
var setupViewPortForSVG = /* @__PURE__ */ __name((svg, padding, cssDiagram, useMaxWidth) => {
|
||||
svg.attr("class", cssDiagram);
|
||||
const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);
|
||||
configureSvgSize(svg, height, width, useMaxWidth);
|
||||
const viewBox = createViewBox(x, y, width, height, padding);
|
||||
svg.attr("viewBox", viewBox);
|
||||
log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`);
|
||||
}, "setupViewPortForSVG");
|
||||
var calculateDimensionsWithPadding = /* @__PURE__ */ __name((svg, padding) => {
|
||||
const bounds = svg.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 };
|
||||
return {
|
||||
width: bounds.width + padding * 2,
|
||||
height: bounds.height + padding * 2,
|
||||
x: bounds.x,
|
||||
y: bounds.y
|
||||
};
|
||||
}, "calculateDimensionsWithPadding");
|
||||
var createViewBox = /* @__PURE__ */ __name((x, y, width, height, padding) => {
|
||||
return `${x - padding} ${y - padding} ${width} ${height}`;
|
||||
}, "createViewBox");
|
||||
|
||||
export { setupViewPortForSVG as s };
|
||||
@@ -1,27 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const index = require('./index-BSSKeTjn.cjs');
|
||||
|
||||
// src/rendering-util/setupViewPortForSVG.ts
|
||||
var setupViewPortForSVG = /* @__PURE__ */ index.__name((svg, padding, cssDiagram, useMaxWidth) => {
|
||||
svg.attr("class", cssDiagram);
|
||||
const { width, height, x, y } = calculateDimensionsWithPadding(svg, padding);
|
||||
index.configureSvgSize(svg, height, width, useMaxWidth);
|
||||
const viewBox = createViewBox(x, y, width, height, padding);
|
||||
svg.attr("viewBox", viewBox);
|
||||
index.log.debug(`viewBox configured: ${viewBox} with padding: ${padding}`);
|
||||
}, "setupViewPortForSVG");
|
||||
var calculateDimensionsWithPadding = /* @__PURE__ */ index.__name((svg, padding) => {
|
||||
const bounds = svg.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 };
|
||||
return {
|
||||
width: bounds.width + padding * 2,
|
||||
height: bounds.height + padding * 2,
|
||||
x: bounds.x,
|
||||
y: bounds.y
|
||||
};
|
||||
}, "calculateDimensionsWithPadding");
|
||||
var createViewBox = /* @__PURE__ */ index.__name((x, y, width, height, padding) => {
|
||||
return `${x - padding} ${y - padding} ${width} ${height}`;
|
||||
}, "createViewBox");
|
||||
|
||||
exports.setupViewPortForSVG = setupViewPortForSVG;
|
||||
@@ -1,17 +0,0 @@
|
||||
import { _ as __name } from './index-BnaE_tRw.js';
|
||||
|
||||
// src/diagrams/common/populateCommonDb.ts
|
||||
function populateCommonDb(ast, db) {
|
||||
if (ast.accDescr) {
|
||||
db.setAccDescription?.(ast.accDescr);
|
||||
}
|
||||
if (ast.accTitle) {
|
||||
db.setAccTitle?.(ast.accTitle);
|
||||
}
|
||||
if (ast.title) {
|
||||
db.setDiagramTitle?.(ast.title);
|
||||
}
|
||||
}
|
||||
__name(populateCommonDb, "populateCommonDb");
|
||||
|
||||
export { populateCommonDb as p };
|
||||
@@ -1,19 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const index = require('./index-BSSKeTjn.cjs');
|
||||
|
||||
// src/diagrams/common/populateCommonDb.ts
|
||||
function populateCommonDb(ast, db) {
|
||||
if (ast.accDescr) {
|
||||
db.setAccDescription?.(ast.accDescr);
|
||||
}
|
||||
if (ast.accTitle) {
|
||||
db.setAccTitle?.(ast.accTitle);
|
||||
}
|
||||
if (ast.title) {
|
||||
db.setDiagramTitle?.(ast.title);
|
||||
}
|
||||
}
|
||||
index.__name(populateCommonDb, "populateCommonDb");
|
||||
|
||||
exports.populateCommonDb = populateCommonDb;
|
||||
@@ -1,15 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
const index = require('./index-BSSKeTjn.cjs');
|
||||
|
||||
var getDiagramElement = /* @__PURE__ */ index.__name((id, securityLevel) => {
|
||||
let sandboxElement;
|
||||
if (securityLevel === "sandbox") {
|
||||
sandboxElement = index.select("#i" + id);
|
||||
}
|
||||
const root = securityLevel === "sandbox" ? index.select(sandboxElement.nodes()[0].contentDocument.body) : index.select("body");
|
||||
const svg = root.select(`[id="${id}"]`);
|
||||
return svg;
|
||||
}, "getDiagramElement");
|
||||
|
||||
exports.getDiagramElement = getDiagramElement;
|
||||
@@ -1,13 +0,0 @@
|
||||
import { _ as __name, d as select } from './index-BnaE_tRw.js';
|
||||
|
||||
var getDiagramElement = /* @__PURE__ */ __name((id, securityLevel) => {
|
||||
let sandboxElement;
|
||||
if (securityLevel === "sandbox") {
|
||||
sandboxElement = select("#i" + id);
|
||||
}
|
||||
const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
|
||||
const svg = root.select(`[id="${id}"]`);
|
||||
return svg;
|
||||
}, "getDiagramElement");
|
||||
|
||||
export { getDiagramElement as g };
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user