@opendata-ai/openchart-vanilla 6.1.1 → 6.1.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/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/graph/canvas-renderer.ts +2 -4
- package/src/svg-renderer.ts +1 -3
- package/src/table-renderer.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -239,6 +239,7 @@ function createSimulationWorker() {
|
|
|
239
239
|
import { compileGraph } from "@opendata-ai/openchart-engine";
|
|
240
240
|
|
|
241
241
|
// src/graph/canvas-renderer.ts
|
|
242
|
+
import { BRAND_FONT_SIZE, BRAND_MIN_WIDTH } from "@opendata-ai/openchart-core";
|
|
242
243
|
var LABEL_FONT_MIN = 8;
|
|
243
244
|
var LABEL_FONT_MAX = 12;
|
|
244
245
|
var EDGE_ALPHA_DEFAULT = 0.35;
|
|
@@ -251,7 +252,6 @@ var GLOW_ALPHA = 0.15;
|
|
|
251
252
|
var CULL_MARGIN = 50;
|
|
252
253
|
var TWO_PI = Math.PI * 2;
|
|
253
254
|
var MIN_SCREEN_RADIUS = 2.5;
|
|
254
|
-
var BRAND_MIN_WIDTH = 120;
|
|
255
255
|
function labelThreshold(zoom) {
|
|
256
256
|
const t = Math.max(0, Math.min(1, (zoom - 0.2) / 1.8));
|
|
257
257
|
return 1 - t;
|
|
@@ -386,7 +386,7 @@ var GraphCanvasRenderer = class {
|
|
|
386
386
|
const padding = theme.spacing.padding;
|
|
387
387
|
const x3 = w - padding;
|
|
388
388
|
const y3 = h - padding;
|
|
389
|
-
ctx.font = `600
|
|
389
|
+
ctx.font = `600 ${BRAND_FONT_SIZE}px ${theme.fonts.family}`;
|
|
390
390
|
ctx.fillStyle = theme.colors.axis;
|
|
391
391
|
ctx.globalAlpha = 0.55;
|
|
392
392
|
ctx.textAlign = "right";
|
|
@@ -3214,7 +3214,7 @@ import { isLayerSpec } from "@opendata-ai/openchart-core";
|
|
|
3214
3214
|
import { compileChart, compileLayer } from "@opendata-ai/openchart-engine";
|
|
3215
3215
|
|
|
3216
3216
|
// src/svg-renderer.ts
|
|
3217
|
-
import { estimateTextWidth } from "@opendata-ai/openchart-core";
|
|
3217
|
+
import { BRAND_FONT_SIZE as BRAND_FONT_SIZE2, BRAND_MIN_WIDTH as BRAND_MIN_WIDTH2, estimateTextWidth } from "@opendata-ai/openchart-core";
|
|
3218
3218
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
3219
3219
|
function computeXAxisExtent(layout) {
|
|
3220
3220
|
const xAxis = layout.axes.x;
|
|
@@ -4025,8 +4025,6 @@ function renderLegend(parent, legend) {
|
|
|
4025
4025
|
}
|
|
4026
4026
|
parent.appendChild(g);
|
|
4027
4027
|
}
|
|
4028
|
-
var BRAND_FONT_SIZE = 20;
|
|
4029
|
-
var BRAND_MIN_WIDTH2 = 120;
|
|
4030
4028
|
var BRAND_URL = "https://tryopendata.ai";
|
|
4031
4029
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
4032
4030
|
function renderBrand(parent, layout) {
|
|
@@ -4052,7 +4050,7 @@ function renderBrand(parent, layout) {
|
|
|
4052
4050
|
y: chromeY,
|
|
4053
4051
|
"dominant-baseline": "hanging",
|
|
4054
4052
|
"font-family": layout.theme.fonts.family,
|
|
4055
|
-
"font-size":
|
|
4053
|
+
"font-size": BRAND_FONT_SIZE2,
|
|
4056
4054
|
"text-anchor": "end",
|
|
4057
4055
|
"fill-opacity": 0.55
|
|
4058
4056
|
});
|
|
@@ -5851,8 +5849,8 @@ import { getBreakpoint } from "@opendata-ai/openchart-core";
|
|
|
5851
5849
|
import { compileTable } from "@opendata-ai/openchart-engine";
|
|
5852
5850
|
|
|
5853
5851
|
// src/table-renderer.ts
|
|
5852
|
+
import { BRAND_FONT_SIZE as BRAND_FONT_SIZE3 } from "@opendata-ai/openchart-core";
|
|
5854
5853
|
var BRAND_URL2 = "https://tryopendata.ai";
|
|
5855
|
-
var BRAND_FONT_SIZE2 = 20;
|
|
5856
5854
|
function renderChromeBlock(layout, position) {
|
|
5857
5855
|
const chrome = layout.chrome;
|
|
5858
5856
|
if (position === "header") {
|
|
@@ -6099,7 +6097,7 @@ function renderTable(layout, container) {
|
|
|
6099
6097
|
brandLink.href = BRAND_URL2;
|
|
6100
6098
|
brandLink.target = "_blank";
|
|
6101
6099
|
brandLink.rel = "noopener";
|
|
6102
|
-
brandLink.style.cssText = `font-size: ${
|
|
6100
|
+
brandLink.style.cssText = `font-size: ${BRAND_FONT_SIZE3}px; font-weight: 600; color: ${brandColor}; opacity: 0.55; text-decoration: none; font-family: ${theme ? theme.fonts.family : "sans-serif"};`;
|
|
6103
6101
|
brandLink.textContent = "OpenData";
|
|
6104
6102
|
brand.appendChild(brandLink);
|
|
6105
6103
|
wrapper.appendChild(brand);
|