@mui/x-charts-premium 9.7.0 → 9.8.0
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/BarChartPremium/webgl/BarWebGLProgram.d.mts +4 -5
- package/BarChartPremium/webgl/BarWebGLProgram.d.ts +4 -5
- package/BarChartPremium/webgl/BarWebGLProgram.js +24 -65
- package/BarChartPremium/webgl/BarWebGLProgram.mjs +24 -65
- package/BarChartPremium/webgl/shaders.d.mts +1 -1
- package/BarChartPremium/webgl/shaders.d.ts +1 -1
- package/BarChartPremium/webgl/shaders.js +2 -15
- package/BarChartPremium/webgl/shaders.mjs +3 -15
- package/CHANGELOG.md +130 -1
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.js +2 -2
- package/ChartsDataProviderPremium/ChartsDataProviderPremium.mjs +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.js +2 -2
- package/ChartsGeoDataProviderPremium/ChartsGeoDataProviderPremium.mjs +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.js +2 -2
- package/ChartsRadialDataProviderPremium/ChartsRadialDataProviderPremium.mjs +2 -2
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.js +12 -37
- package/HeatmapPremium/webgl/HeatmapWebGLProgram.mjs +12 -37
- package/HeatmapPremium/webgl/shaders.d.mts +3 -3
- package/HeatmapPremium/webgl/shaders.d.ts +3 -3
- package/HeatmapPremium/webgl/shaders.js +12 -15
- package/HeatmapPremium/webgl/shaders.mjs +13 -15
- package/HeatmapPremium/webgl/useHeatmapPlotData.js +3 -8
- package/HeatmapPremium/webgl/useHeatmapPlotData.mjs +3 -8
- package/Map/FocusedMapShape.js +5 -1
- package/Map/FocusedMapShape.mjs +5 -1
- package/Map/MapImagePlot.d.mts +39 -0
- package/Map/MapImagePlot.d.ts +39 -0
- package/Map/MapImagePlot.js +138 -0
- package/Map/MapImagePlot.mjs +132 -0
- package/Map/MapShape.d.mts +1 -1
- package/Map/MapShape.d.ts +1 -1
- package/Map/MapShape.js +6 -6
- package/Map/MapShape.mjs +6 -6
- package/Map/MapShapePlot.d.mts +8 -0
- package/Map/MapShapePlot.d.ts +8 -0
- package/Map/MapShapePlot.js +17 -5
- package/Map/MapShapePlot.mjs +17 -5
- package/Map/index.d.mts +1 -0
- package/Map/index.d.ts +1 -0
- package/Map/index.js +11 -0
- package/Map/index.mjs +1 -0
- package/Map/reprojectEquirectangularImage.d.mts +60 -0
- package/Map/reprojectEquirectangularImage.d.ts +60 -0
- package/Map/reprojectEquirectangularImage.js +116 -0
- package/Map/reprojectEquirectangularImage.mjs +110 -0
- package/Map/seriesConfig/descriptionGetter.js +5 -1
- package/Map/seriesConfig/descriptionGetter.mjs +5 -1
- package/Map/seriesConfig/getColor.js +18 -6
- package/Map/seriesConfig/getColor.mjs +18 -6
- package/Map/seriesConfig/highlight.d.mts +10 -0
- package/Map/seriesConfig/highlight.d.ts +10 -0
- package/Map/seriesConfig/highlight.js +52 -0
- package/Map/seriesConfig/highlight.mjs +45 -0
- package/Map/seriesConfig/identifierCleaner.d.mts +3 -0
- package/Map/seriesConfig/identifierCleaner.d.ts +3 -0
- package/Map/seriesConfig/identifierCleaner.js +14 -0
- package/Map/seriesConfig/identifierCleaner.mjs +8 -0
- package/Map/seriesConfig/identifierSerializer.d.mts +3 -0
- package/Map/seriesConfig/identifierSerializer.d.ts +3 -0
- package/Map/seriesConfig/identifierSerializer.js +12 -0
- package/Map/seriesConfig/identifierSerializer.mjs +6 -0
- package/Map/seriesConfig/index.js +8 -6
- package/Map/seriesConfig/index.mjs +7 -5
- package/Map/seriesConfig/keyboardFocusHandler.d.mts +0 -6
- package/Map/seriesConfig/keyboardFocusHandler.d.ts +0 -6
- package/Map/seriesConfig/keyboardFocusHandler.js +40 -7
- package/Map/seriesConfig/keyboardFocusHandler.mjs +41 -8
- package/Map/seriesConfig/seriesProcessor.js +11 -2
- package/Map/seriesConfig/seriesProcessor.mjs +11 -2
- package/Map/seriesConfig/tooltip.js +8 -4
- package/Map/seriesConfig/tooltip.mjs +8 -4
- package/Map/seriesConfig/tooltipPosition.d.mts +8 -3
- package/Map/seriesConfig/tooltipPosition.d.ts +8 -3
- package/Map/seriesConfig/tooltipPosition.js +21 -27
- package/Map/seriesConfig/tooltipPosition.mjs +22 -27
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.mts +0 -2
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.d.ts +0 -2
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.js +23 -81
- package/ScatterChartPremium/webgl/ScatterWebGLProgram.mjs +23 -81
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/createGetVisibleCoordinate.d.mts +14 -0
- package/internals/createGetVisibleCoordinate.d.ts +14 -0
- package/internals/createGetVisibleCoordinate.js +66 -0
- package/internals/createGetVisibleCoordinate.mjs +60 -0
- package/models/seriesType/mapShape.d.mts +2 -1
- package/models/seriesType/mapShape.d.ts +2 -1
- package/package.json +5 -5
- package/utils/webgl/glsl.d.mts +15 -0
- package/utils/webgl/glsl.d.ts +15 -0
- package/utils/webgl/glsl.js +34 -0
- package/utils/webgl/glsl.mjs +28 -0
- package/utils/webgl/instancedAttribute.d.mts +28 -0
- package/utils/webgl/instancedAttribute.d.ts +28 -0
- package/utils/webgl/instancedAttribute.js +57 -0
- package/utils/webgl/instancedAttribute.mjs +50 -0
- package/utils/webgl/utils.d.mts +21 -2
- package/utils/webgl/utils.d.ts +21 -2
- package/utils/webgl/utils.js +44 -8
- package/utils/webgl/utils.mjs +41 -7
|
@@ -5,11 +5,10 @@ export declare class BarWebGLProgram {
|
|
|
5
5
|
private readonly program;
|
|
6
6
|
private readonly vao;
|
|
7
7
|
private readonly quadBuffer;
|
|
8
|
-
private readonly
|
|
9
|
-
private readonly
|
|
10
|
-
private readonly
|
|
11
|
-
private readonly
|
|
12
|
-
private readonly cornerRadiiBuffer;
|
|
8
|
+
private readonly centers;
|
|
9
|
+
private readonly halfSizes;
|
|
10
|
+
private readonly colors;
|
|
11
|
+
private readonly cornerRadii;
|
|
13
12
|
private readonly uResolution;
|
|
14
13
|
constructor(gl: WebGL2RenderingContext);
|
|
15
14
|
setResolution(width: number, height: number): void;
|
|
@@ -5,11 +5,10 @@ export declare class BarWebGLProgram {
|
|
|
5
5
|
private readonly program;
|
|
6
6
|
private readonly vao;
|
|
7
7
|
private readonly quadBuffer;
|
|
8
|
-
private readonly
|
|
9
|
-
private readonly
|
|
10
|
-
private readonly
|
|
11
|
-
private readonly
|
|
12
|
-
private readonly cornerRadiiBuffer;
|
|
8
|
+
private readonly centers;
|
|
9
|
+
private readonly halfSizes;
|
|
10
|
+
private readonly colors;
|
|
11
|
+
private readonly cornerRadii;
|
|
13
12
|
private readonly uResolution;
|
|
14
13
|
constructor(gl: WebGL2RenderingContext);
|
|
15
14
|
setResolution(width: number, height: number): void;
|
|
@@ -5,36 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.BarWebGLProgram = void 0;
|
|
7
7
|
var _utils = require("../../utils/webgl/utils");
|
|
8
|
+
var _instancedAttribute = require("../../utils/webgl/instancedAttribute");
|
|
8
9
|
var _shaders = require("./shaders");
|
|
9
10
|
class BarWebGLProgram {
|
|
10
11
|
shaders = [];
|
|
12
|
+
|
|
13
|
+
/* Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1]. */
|
|
14
|
+
|
|
11
15
|
constructor(gl) {
|
|
12
16
|
this.gl = gl;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.program =
|
|
16
|
-
|
|
17
|
-
const fragmentShader = (0, _utils.compileShader)(gl, _shaders.barFragmentShaderSource, gl.FRAGMENT_SHADER);
|
|
18
|
-
gl.attachShader(this.program, vertexShader);
|
|
19
|
-
gl.attachShader(this.program, fragmentShader);
|
|
20
|
-
gl.linkProgram(this.program);
|
|
21
|
-
this.shaders.push(vertexShader, fragmentShader);
|
|
22
|
-
if (process.env.NODE_ENV !== 'production' && !gl.getProgramParameter(this.program, gl.LINK_STATUS)) {
|
|
23
|
-
console.error(`Program linking failed: ${gl.getProgramInfoLog(this.program)}`);
|
|
24
|
-
console.error(`Vertex info-log: ${gl.getShaderInfoLog(vertexShader)}`);
|
|
25
|
-
console.error(`Fragment info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Cache locations once.
|
|
17
|
+
(0, _utils.setupStandardBlending)(gl);
|
|
18
|
+
const linked = (0, _utils.linkProgram)(gl, _shaders.barVertexShaderSource, _shaders.barFragmentShaderSource);
|
|
19
|
+
this.program = linked.program;
|
|
20
|
+
this.shaders.push(...linked.shaders);
|
|
29
21
|
this.uResolution = gl.getUniformLocation(this.program, 'u_resolution');
|
|
30
|
-
this.aPositionLocation = gl.getAttribLocation(this.program, 'a_position');
|
|
31
22
|
this.quadBuffer = (0, _utils.uploadQuadBuffer)(gl);
|
|
32
23
|
this.vao = gl.createVertexArray();
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
24
|
+
gl.bindVertexArray(this.vao);
|
|
25
|
+
(0, _utils.bindQuadBuffer)(gl, this.program, this.quadBuffer);
|
|
26
|
+
this.centers = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_center', 2);
|
|
27
|
+
this.halfSizes = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_halfSize', 2);
|
|
28
|
+
this.colors = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
|
|
29
|
+
this.cornerRadii = (0, _instancedAttribute.createInstancedAttribute)(gl, this.program, 'a_cornerRadii', 4);
|
|
30
|
+
gl.bindVertexArray(null);
|
|
38
31
|
}
|
|
39
32
|
setResolution(width, height) {
|
|
40
33
|
this.gl.useProgram(this.program);
|
|
@@ -42,18 +35,10 @@ class BarWebGLProgram {
|
|
|
42
35
|
}
|
|
43
36
|
plot(plotData) {
|
|
44
37
|
const gl = this.gl;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
|
|
50
|
-
gl.enableVertexAttribArray(this.aPositionLocation);
|
|
51
|
-
gl.vertexAttribPointer(this.aPositionLocation, 2, gl.FLOAT, false, 0, 0);
|
|
52
|
-
uploadAndBindInstanced(gl, this.centersBuffer, plotData.centers);
|
|
53
|
-
uploadAndBindInstanced(gl, this.halfSizesBuffer, plotData.halfSizes);
|
|
54
|
-
uploadAndBindInstanced(gl, this.colorsBuffer, plotData.colors);
|
|
55
|
-
uploadAndBindInstanced(gl, this.cornerRadiiBuffer, plotData.cornerRadii);
|
|
56
|
-
gl.bindVertexArray(null);
|
|
38
|
+
(0, _utils.uploadGrowableBuffer)(gl, this.centers.buffer, plotData.centers);
|
|
39
|
+
(0, _utils.uploadGrowableBuffer)(gl, this.halfSizes.buffer, plotData.halfSizes);
|
|
40
|
+
(0, _utils.uploadGrowableBuffer)(gl, this.colors.buffer, plotData.colors);
|
|
41
|
+
(0, _utils.uploadGrowableBuffer)(gl, this.cornerRadii.buffer, plotData.cornerRadii);
|
|
57
42
|
(0, _utils.logWebGLErrors)(gl);
|
|
58
43
|
}
|
|
59
44
|
render(count) {
|
|
@@ -71,37 +56,11 @@ class BarWebGLProgram {
|
|
|
71
56
|
gl.deleteProgram(this.program);
|
|
72
57
|
gl.deleteVertexArray(this.vao);
|
|
73
58
|
gl.deleteBuffer(this.quadBuffer);
|
|
74
|
-
gl.deleteBuffer(this.
|
|
75
|
-
gl.deleteBuffer(this.
|
|
76
|
-
gl.deleteBuffer(this.
|
|
77
|
-
gl.deleteBuffer(this.
|
|
59
|
+
gl.deleteBuffer(this.centers.buffer.buffer);
|
|
60
|
+
gl.deleteBuffer(this.halfSizes.buffer.buffer);
|
|
61
|
+
gl.deleteBuffer(this.colors.buffer.buffer);
|
|
62
|
+
gl.deleteBuffer(this.cornerRadii.buffer.buffer);
|
|
78
63
|
this.shaders.forEach(shader => gl.deleteShader(shader));
|
|
79
64
|
}
|
|
80
65
|
}
|
|
81
|
-
exports.BarWebGLProgram = BarWebGLProgram;
|
|
82
|
-
function createInstancedBuffer(gl, program, name, size, glType, normalized) {
|
|
83
|
-
return {
|
|
84
|
-
buffer: gl.createBuffer(),
|
|
85
|
-
capacityBytes: 0,
|
|
86
|
-
lastUploaded: null,
|
|
87
|
-
location: gl.getAttribLocation(program, name),
|
|
88
|
-
size,
|
|
89
|
-
glType,
|
|
90
|
-
normalized
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
function uploadAndBindInstanced(gl, target, data) {
|
|
94
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, target.buffer);
|
|
95
|
-
if (target.lastUploaded !== data) {
|
|
96
|
-
if (data.byteLength <= target.capacityBytes) {
|
|
97
|
-
gl.bufferSubData(gl.ARRAY_BUFFER, 0, data);
|
|
98
|
-
} else {
|
|
99
|
-
gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);
|
|
100
|
-
target.capacityBytes = data.byteLength;
|
|
101
|
-
}
|
|
102
|
-
target.lastUploaded = data;
|
|
103
|
-
}
|
|
104
|
-
gl.enableVertexAttribArray(target.location);
|
|
105
|
-
gl.vertexAttribPointer(target.location, target.size, target.glType, target.normalized, 0, 0);
|
|
106
|
-
gl.vertexAttribDivisor(target.location, 1);
|
|
107
|
-
}
|
|
66
|
+
exports.BarWebGLProgram = BarWebGLProgram;
|
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bindQuadBuffer, linkProgram, logWebGLErrors, setupStandardBlending, uploadGrowableBuffer, uploadQuadBuffer } from "../../utils/webgl/utils.mjs";
|
|
2
|
+
import { createInstancedAttribute } from "../../utils/webgl/instancedAttribute.mjs";
|
|
2
3
|
import { barFragmentShaderSource, barVertexShaderSource } from "./shaders.mjs";
|
|
3
4
|
export class BarWebGLProgram {
|
|
4
5
|
shaders = [];
|
|
6
|
+
|
|
7
|
+
/* Colors come in as Uint8 [0, 255]; normalized=true makes the GPU read them back as vec4 in [0, 1]. */
|
|
8
|
+
|
|
5
9
|
constructor(gl) {
|
|
6
10
|
this.gl = gl;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this.program =
|
|
10
|
-
|
|
11
|
-
const fragmentShader = compileShader(gl, barFragmentShaderSource, gl.FRAGMENT_SHADER);
|
|
12
|
-
gl.attachShader(this.program, vertexShader);
|
|
13
|
-
gl.attachShader(this.program, fragmentShader);
|
|
14
|
-
gl.linkProgram(this.program);
|
|
15
|
-
this.shaders.push(vertexShader, fragmentShader);
|
|
16
|
-
if (process.env.NODE_ENV !== 'production' && !gl.getProgramParameter(this.program, gl.LINK_STATUS)) {
|
|
17
|
-
console.error(`Program linking failed: ${gl.getProgramInfoLog(this.program)}`);
|
|
18
|
-
console.error(`Vertex info-log: ${gl.getShaderInfoLog(vertexShader)}`);
|
|
19
|
-
console.error(`Fragment info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Cache locations once.
|
|
11
|
+
setupStandardBlending(gl);
|
|
12
|
+
const linked = linkProgram(gl, barVertexShaderSource, barFragmentShaderSource);
|
|
13
|
+
this.program = linked.program;
|
|
14
|
+
this.shaders.push(...linked.shaders);
|
|
23
15
|
this.uResolution = gl.getUniformLocation(this.program, 'u_resolution');
|
|
24
|
-
this.aPositionLocation = gl.getAttribLocation(this.program, 'a_position');
|
|
25
16
|
this.quadBuffer = uploadQuadBuffer(gl);
|
|
26
17
|
this.vao = gl.createVertexArray();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
18
|
+
gl.bindVertexArray(this.vao);
|
|
19
|
+
bindQuadBuffer(gl, this.program, this.quadBuffer);
|
|
20
|
+
this.centers = createInstancedAttribute(gl, this.program, 'a_center', 2);
|
|
21
|
+
this.halfSizes = createInstancedAttribute(gl, this.program, 'a_halfSize', 2);
|
|
22
|
+
this.colors = createInstancedAttribute(gl, this.program, 'a_color', 4, gl.UNSIGNED_BYTE, true);
|
|
23
|
+
this.cornerRadii = createInstancedAttribute(gl, this.program, 'a_cornerRadii', 4);
|
|
24
|
+
gl.bindVertexArray(null);
|
|
32
25
|
}
|
|
33
26
|
setResolution(width, height) {
|
|
34
27
|
this.gl.useProgram(this.program);
|
|
@@ -36,18 +29,10 @@ export class BarWebGLProgram {
|
|
|
36
29
|
}
|
|
37
30
|
plot(plotData) {
|
|
38
31
|
const gl = this.gl;
|
|
39
|
-
gl
|
|
40
|
-
gl
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
|
|
44
|
-
gl.enableVertexAttribArray(this.aPositionLocation);
|
|
45
|
-
gl.vertexAttribPointer(this.aPositionLocation, 2, gl.FLOAT, false, 0, 0);
|
|
46
|
-
uploadAndBindInstanced(gl, this.centersBuffer, plotData.centers);
|
|
47
|
-
uploadAndBindInstanced(gl, this.halfSizesBuffer, plotData.halfSizes);
|
|
48
|
-
uploadAndBindInstanced(gl, this.colorsBuffer, plotData.colors);
|
|
49
|
-
uploadAndBindInstanced(gl, this.cornerRadiiBuffer, plotData.cornerRadii);
|
|
50
|
-
gl.bindVertexArray(null);
|
|
32
|
+
uploadGrowableBuffer(gl, this.centers.buffer, plotData.centers);
|
|
33
|
+
uploadGrowableBuffer(gl, this.halfSizes.buffer, plotData.halfSizes);
|
|
34
|
+
uploadGrowableBuffer(gl, this.colors.buffer, plotData.colors);
|
|
35
|
+
uploadGrowableBuffer(gl, this.cornerRadii.buffer, plotData.cornerRadii);
|
|
51
36
|
logWebGLErrors(gl);
|
|
52
37
|
}
|
|
53
38
|
render(count) {
|
|
@@ -65,36 +50,10 @@ export class BarWebGLProgram {
|
|
|
65
50
|
gl.deleteProgram(this.program);
|
|
66
51
|
gl.deleteVertexArray(this.vao);
|
|
67
52
|
gl.deleteBuffer(this.quadBuffer);
|
|
68
|
-
gl.deleteBuffer(this.
|
|
69
|
-
gl.deleteBuffer(this.
|
|
70
|
-
gl.deleteBuffer(this.
|
|
71
|
-
gl.deleteBuffer(this.
|
|
53
|
+
gl.deleteBuffer(this.centers.buffer.buffer);
|
|
54
|
+
gl.deleteBuffer(this.halfSizes.buffer.buffer);
|
|
55
|
+
gl.deleteBuffer(this.colors.buffer.buffer);
|
|
56
|
+
gl.deleteBuffer(this.cornerRadii.buffer.buffer);
|
|
72
57
|
this.shaders.forEach(shader => gl.deleteShader(shader));
|
|
73
58
|
}
|
|
74
|
-
}
|
|
75
|
-
function createInstancedBuffer(gl, program, name, size, glType, normalized) {
|
|
76
|
-
return {
|
|
77
|
-
buffer: gl.createBuffer(),
|
|
78
|
-
capacityBytes: 0,
|
|
79
|
-
lastUploaded: null,
|
|
80
|
-
location: gl.getAttribLocation(program, name),
|
|
81
|
-
size,
|
|
82
|
-
glType,
|
|
83
|
-
normalized
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function uploadAndBindInstanced(gl, target, data) {
|
|
87
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, target.buffer);
|
|
88
|
-
if (target.lastUploaded !== data) {
|
|
89
|
-
if (data.byteLength <= target.capacityBytes) {
|
|
90
|
-
gl.bufferSubData(gl.ARRAY_BUFFER, 0, data);
|
|
91
|
-
} else {
|
|
92
|
-
gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);
|
|
93
|
-
target.capacityBytes = data.byteLength;
|
|
94
|
-
}
|
|
95
|
-
target.lastUploaded = data;
|
|
96
|
-
}
|
|
97
|
-
gl.enableVertexAttribArray(target.location);
|
|
98
|
-
gl.vertexAttribPointer(target.location, target.size, target.glType, target.normalized, 0, 0);
|
|
99
|
-
gl.vertexAttribDivisor(target.location, 1);
|
|
100
59
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const barVertexShaderSource = "\n precision mediump float;\n\n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec2 a_halfSize;\n attribute vec4 a_color;\n attribute vec4 a_cornerRadii;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n uniform vec2 u_resolution;\n\n void main() {\n vec2 position = a_center + a_position * a_halfSize;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\n v_color = a_color;\n v_pos = a_position * a_halfSize;\n v_halfSize = a_halfSize;\n v_cornerRadii = a_cornerRadii;\n }\n ";
|
|
2
|
-
export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
|
|
2
|
+
export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n \n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n \n\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const barVertexShaderSource = "\n precision mediump float;\n\n attribute vec2 a_position;\n attribute vec2 a_center;\n attribute vec2 a_halfSize;\n attribute vec4 a_color;\n attribute vec4 a_cornerRadii;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n uniform vec2 u_resolution;\n\n void main() {\n vec2 position = a_center + a_position * a_halfSize;\n vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0;\n gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1);\n\n v_color = a_color;\n v_pos = a_position * a_halfSize;\n v_halfSize = a_halfSize;\n v_cornerRadii = a_cornerRadii;\n }\n ";
|
|
2
|
-
export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
|
|
2
|
+
export declare const barFragmentShaderSource = "\n precision mediump float;\n\n varying vec4 v_color;\n varying vec2 v_pos;\n varying vec2 v_halfSize;\n varying vec4 v_cornerRadii;\n\n \n float roundedBoxSDF(vec2 pos, vec2 halfSize, vec4 r) {\n float radius;\n if (pos.x < 0.0) {\n radius = pos.y < 0.0 ? r.x : r.w;\n } else {\n radius = pos.y < 0.0 ? r.y : r.z;\n }\n\n vec2 q = abs(pos) - halfSize + radius;\n return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;\n }\n \n\n void main() {\n float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);\n // Anti-alias only outside the SDF (dist >= 0). Starting smoothstep at 0\n // keeps interior pixels at full color instead of fading them.\n float alpha = 1.0 - smoothstep(0.0, 0.5, dist);\n\n gl_FragColor = vec4(v_color.rgb, v_color.a * alpha);\n }\n ";
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.barVertexShaderSource = exports.barFragmentShaderSource = void 0;
|
|
7
|
+
var _glsl = require("../../utils/webgl/glsl");
|
|
7
8
|
// language=Glsl
|
|
8
9
|
const barVertexShaderSource = exports.barVertexShaderSource = /* glsl */`
|
|
9
10
|
precision mediump float;
|
|
@@ -34,10 +35,6 @@ const barVertexShaderSource = exports.barVertexShaderSource = /* glsl */`
|
|
|
34
35
|
`;
|
|
35
36
|
|
|
36
37
|
// language=Glsl
|
|
37
|
-
// Per-corner radii ordering follows CSS: top-left, top-right, bottom-right, bottom-left.
|
|
38
|
-
// Screen-space conventions after the y-flip in the vertex stage:
|
|
39
|
-
// v_pos.y < 0 -> top, v_pos.y > 0 -> bottom
|
|
40
|
-
// v_pos.x < 0 -> left, v_pos.x > 0 -> right
|
|
41
38
|
const barFragmentShaderSource = exports.barFragmentShaderSource = /* glsl */`
|
|
42
39
|
precision mediump float;
|
|
43
40
|
|
|
@@ -46,17 +43,7 @@ const barFragmentShaderSource = exports.barFragmentShaderSource = /* glsl */`
|
|
|
46
43
|
varying vec2 v_halfSize;
|
|
47
44
|
varying vec4 v_cornerRadii;
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
float radius;
|
|
51
|
-
if (pos.x < 0.0) {
|
|
52
|
-
radius = pos.y < 0.0 ? r.x : r.w;
|
|
53
|
-
} else {
|
|
54
|
-
radius = pos.y < 0.0 ? r.y : r.z;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
vec2 q = abs(pos) - halfSize + radius;
|
|
58
|
-
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
|
|
59
|
-
}
|
|
46
|
+
${_glsl.ROUNDED_BOX_SDF_GLSL}
|
|
60
47
|
|
|
61
48
|
void main() {
|
|
62
49
|
float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ROUNDED_BOX_SDF_GLSL } from "../../utils/webgl/glsl.mjs";
|
|
2
|
+
|
|
1
3
|
// language=Glsl
|
|
2
4
|
export const barVertexShaderSource = /* glsl */`
|
|
3
5
|
precision mediump float;
|
|
@@ -28,10 +30,6 @@ export const barVertexShaderSource = /* glsl */`
|
|
|
28
30
|
`;
|
|
29
31
|
|
|
30
32
|
// language=Glsl
|
|
31
|
-
// Per-corner radii ordering follows CSS: top-left, top-right, bottom-right, bottom-left.
|
|
32
|
-
// Screen-space conventions after the y-flip in the vertex stage:
|
|
33
|
-
// v_pos.y < 0 -> top, v_pos.y > 0 -> bottom
|
|
34
|
-
// v_pos.x < 0 -> left, v_pos.x > 0 -> right
|
|
35
33
|
export const barFragmentShaderSource = /* glsl */`
|
|
36
34
|
precision mediump float;
|
|
37
35
|
|
|
@@ -40,17 +38,7 @@ export const barFragmentShaderSource = /* glsl */`
|
|
|
40
38
|
varying vec2 v_halfSize;
|
|
41
39
|
varying vec4 v_cornerRadii;
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
float radius;
|
|
45
|
-
if (pos.x < 0.0) {
|
|
46
|
-
radius = pos.y < 0.0 ? r.x : r.w;
|
|
47
|
-
} else {
|
|
48
|
-
radius = pos.y < 0.0 ? r.y : r.z;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
vec2 q = abs(pos) - halfSize + radius;
|
|
52
|
-
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - radius;
|
|
53
|
-
}
|
|
41
|
+
${ROUNDED_BOX_SDF_GLSL}
|
|
54
42
|
|
|
55
43
|
void main() {
|
|
56
44
|
float dist = roundedBoxSDF(v_pos, v_halfSize, v_cornerRadii);
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,135 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.8.0
|
|
4
|
+
|
|
5
|
+
_Jul 2, 2026_
|
|
6
|
+
|
|
7
|
+
We'd like to extend a big thank you to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
8
|
+
|
|
9
|
+
- 🗺️ New [`MapImagePlot`](https://mui.com/x/react-charts/map/) for rendering raster base maps, with `onItemClick` support on map shapes (Premium)
|
|
10
|
+
- 📊 New [`usePolarGeometry`](https://mui.com/x/react-charts/hooks/use-polar-geometry/) hook to build custom radial overlays
|
|
11
|
+
- 🐞 Bugfixes
|
|
12
|
+
- 📚 Documentation improvements
|
|
13
|
+
|
|
14
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
15
|
+
@Anexus5919, @aromanio, @greymoth-jp, @mustafajw07, @timbuckley, @voidmatcha
|
|
16
|
+
|
|
17
|
+
The following team members contributed to this release:
|
|
18
|
+
@alexfauquette, @arminmeh, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @joserodolfofreitas, @LukasTy, @mapache-salvaje, @michelengelen, @rita-codes, @sai6855
|
|
19
|
+
|
|
20
|
+
### Data Grid
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid@9.8.0`
|
|
23
|
+
|
|
24
|
+
- [DataGrid] Prevent cell editing from resurrecting a deleted row (#22958) @Anexus5919
|
|
25
|
+
- [DataGrid] Avoid reading `type` of `undefined` in `gridRowUtils` (#21808) @timbuckley
|
|
26
|
+
- [DataGrid] Improved get started tutorial (#22911) @joserodolfofreitas
|
|
27
|
+
- [l10n] Improve Japanese (ja-JP) locale (#23001) @greymoth-jp
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid@9.8.0`.
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-premium@9.8.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid-pro@9.8.0`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPremium] Escape `singleSelect` values in Excel export with `escapeFormulas` enabled (#22851) @Anexus5919
|
|
38
|
+
|
|
39
|
+
### Date and Time Pickers
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-date-pickers@9.8.0`
|
|
42
|
+
|
|
43
|
+
- [pickers] Fix localized digit crash (#22995) @alexfauquette
|
|
44
|
+
- [pickers] Flag the first and last visible day cell across year boundaries (#22981) @Anexus5919
|
|
45
|
+
- [pickers] Use calendar day tokens in `AdapterMomentHijri` and `AdapterMomentJalaali` formats (#22974) @Anexus5919
|
|
46
|
+
- [pickers] Use the Hijri day token in `AdapterMomentHijri` `normalDateWithWeekday` (#22972) @Anexus5919
|
|
47
|
+
- [l10n] Improve Romanian (ro-RO) locale (#22969) @aromanio
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-date-pickers-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-date-pickers@9.8.0`, plus:
|
|
52
|
+
|
|
53
|
+
- [DateRangeCalendar] Fix auto month-switch across the year boundary (#22987) @Anexus5919
|
|
54
|
+
|
|
55
|
+
### Charts
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-charts@9.8.0`
|
|
58
|
+
|
|
59
|
+
- [charts] Decouple `d3-geo` from the universal tooltip (#23011) @sai6855
|
|
60
|
+
- [charts] Deduplicate `getGroupingConfig` (#22889) @sai6855
|
|
61
|
+
- [charts] Expose `usePolarGeometry` hook for radial overlays (#22892) @mustafajw07
|
|
62
|
+
|
|
63
|
+
#### `@mui/x-charts-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
64
|
+
|
|
65
|
+
Same changes as in `@mui/x-charts@9.8.0`.
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts-premium@9.8.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
68
|
+
|
|
69
|
+
Same changes as in `@mui/x-charts-pro@9.8.0`, plus:
|
|
70
|
+
|
|
71
|
+
- [charts-premium] Add `onItemClick` support for the Map shapes (#22876) @sai6855
|
|
72
|
+
- [charts-premium] Replace `dataIndex` with `name` in map identifier (#22891) @sai6855
|
|
73
|
+
- [charts-premium] Share helper function (#23030) @alexfauquette
|
|
74
|
+
- [charts-premium] Extract shared WebGL utilities across bar/scatter/heatmap renderers (#22466) @sai6855
|
|
75
|
+
- [charts-premium] Add `MapImagePlot` for raster base maps (#22977) @JCQuintas
|
|
76
|
+
|
|
77
|
+
### Tree View
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-tree-view@9.8.0`
|
|
80
|
+
|
|
81
|
+
- [TreeView] Fix extra selection event when clicking a collapsed parent item (#22249) @michelengelen
|
|
82
|
+
- [TreeView] Enforce top-level type imports (#23034) @Janpot
|
|
83
|
+
|
|
84
|
+
#### `@mui/x-tree-view-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
85
|
+
|
|
86
|
+
Same changes as in `@mui/x-tree-view@9.8.0`.
|
|
87
|
+
|
|
88
|
+
### Scheduler
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-scheduler@9.0.0-beta.4`
|
|
91
|
+
|
|
92
|
+
- [scheduler] Enforce top-level type imports (#22931) @Janpot
|
|
93
|
+
- [scheduler] Keep the occurrence date when editing only one recurring event (#23007) @Anexus5919
|
|
94
|
+
- [scheduler] Track bundle size of scheduler packages (#22682) @flaviendelangle
|
|
95
|
+
- [scheduler] Add `viewConfig` prop to limit displayed hours in the day and week views (#22929) @flaviendelangle
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.4`, plus:
|
|
100
|
+
|
|
101
|
+
- [scheduler] Collapsible resources in the timeline (#22920) @rita-codes
|
|
102
|
+
|
|
103
|
+
### Codemod
|
|
104
|
+
|
|
105
|
+
#### `@mui/x-codemod@9.8.0`
|
|
106
|
+
|
|
107
|
+
Internal changes.
|
|
108
|
+
|
|
109
|
+
### Docs
|
|
110
|
+
|
|
111
|
+
- [docs] Add recipe for conditional master-detail panels (#22971) @michelengelen
|
|
112
|
+
- [docs] Add recipe for describing active filters in the toolbar (#22970) @michelengelen
|
|
113
|
+
- [docs] Add recipe for triggering clipboard copy from a button (#22967) @michelengelen
|
|
114
|
+
- [docs] Clarify that `fieldRef.current.focusField()` is the canonical way to focus a field (#22937) @michelengelen
|
|
115
|
+
- [docs][scheduler] Another copyediting pass across the Scheduler docs (#22619) @mapache-salvaje
|
|
116
|
+
- [docs][charts] Add map example for arbitrary GeoJSON shapes (#22976) @JCQuintas
|
|
117
|
+
- [docs][charts] Double point count in `ScatterAsyncRenderer` demo (#22906) @JCQuintas
|
|
118
|
+
|
|
119
|
+
### Core
|
|
120
|
+
|
|
121
|
+
- [code-infra] Fix tracking branch bug in release script (#22956) @michelengelen
|
|
122
|
+
- [code-infra] Remove mark-duplicate workflow (#22994) @cherniavskii
|
|
123
|
+
- [code-infra] Revert `nanoid@3.3.15` `minimumReleaseAge` exemption (#22953) @LukasTy
|
|
124
|
+
|
|
125
|
+
### Miscellaneous
|
|
126
|
+
|
|
127
|
+
- [internals] Fix `ERR_UNSUPPORTED_DIR_IMPORT` for `core-js-pure` in Node ESM (#22985) @michelengelen
|
|
128
|
+
- [internals] Harden `useDisposable` React internals read with safeReact (#22986) @rita-codes
|
|
129
|
+
- [internals] Replace core-js `DisposableStack` ponyfill with a minimal fallback (#23002) @sai6855
|
|
130
|
+
- [test] Assert the edited `dateTime` cell value in the e2e edit test (#22982) @voidmatcha
|
|
131
|
+
- [virtualizer] Remeasure scrollbars when layout changes (#22914) @arminmeh
|
|
132
|
+
|
|
3
133
|
## 9.7.0
|
|
4
134
|
|
|
5
135
|
_Jun 25, 2026_
|
|
@@ -178,7 +308,6 @@ Same changes as in `@mui/x-charts-pro@9.6.0`, plus:
|
|
|
178
308
|
- [charts-premium] Support maps tooltip positioned on items (#22648) @alexfauquette
|
|
179
309
|
- [docs] Show how to export maps (#22837) @alexfauquette
|
|
180
310
|
|
|
181
|
-
|
|
182
311
|
### Tree View
|
|
183
312
|
|
|
184
313
|
#### `@mui/x-tree-view@9.6.0`
|
|
@@ -19,8 +19,8 @@ var _useChartsDataProviderPremiumProps = require("./useChartsDataProviderPremium
|
|
|
19
19
|
var _seriesConfig2 = require("../CandlestickChart/seriesConfig");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
const packageInfo = {
|
|
22
|
-
releaseDate: "
|
|
23
|
-
version: "9.
|
|
22
|
+
releaseDate: "MTc4Mjk1MDQwMDAwMA==",
|
|
23
|
+
version: "9.8.0",
|
|
24
24
|
name: 'x-charts-premium'
|
|
25
25
|
};
|
|
26
26
|
const defaultSeriesConfigPremium = exports.defaultSeriesConfigPremium = (0, _extends2.default)({}, _internals2.defaultSeriesConfigPro, {
|
|
@@ -12,8 +12,8 @@ import { useChartsDataProviderPremiumProps } from "./useChartsDataProviderPremiu
|
|
|
12
12
|
import { ohlcSeriesConfig } from "../CandlestickChart/seriesConfig/index.mjs";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const packageInfo = {
|
|
15
|
-
releaseDate: "
|
|
16
|
-
version: "9.
|
|
15
|
+
releaseDate: "MTc4Mjk1MDQwMDAwMA==",
|
|
16
|
+
version: "9.8.0",
|
|
17
17
|
name: 'x-charts-premium'
|
|
18
18
|
};
|
|
19
19
|
export const defaultSeriesConfigPremium = _extends({}, defaultSeriesConfigPro, {
|
|
@@ -18,8 +18,8 @@ var _useChartsGeoDataProviderPremiumProps = require("./useChartsGeoDataProviderP
|
|
|
18
18
|
var _ChartsGeoDataProviderPremium = require("./ChartsGeoDataProviderPremium.plugins");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
20
|
const packageInfo = {
|
|
21
|
-
releaseDate: "
|
|
22
|
-
version: "9.
|
|
21
|
+
releaseDate: "MTc4Mjk1MDQwMDAwMA==",
|
|
22
|
+
version: "9.8.0",
|
|
23
23
|
name: 'x-charts-premium'
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
@@ -11,8 +11,8 @@ import { useChartsGeoDataProviderPremiumProps } from "./useChartsGeoDataProvider
|
|
|
11
11
|
import { GEO_PREMIUM_PLUGINS } from "./ChartsGeoDataProviderPremium.plugins.mjs";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const packageInfo = {
|
|
14
|
-
releaseDate: "
|
|
15
|
-
version: "9.
|
|
14
|
+
releaseDate: "MTc4Mjk1MDQwMDAwMA==",
|
|
15
|
+
version: "9.8.0",
|
|
16
16
|
name: 'x-charts-premium'
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
@@ -19,8 +19,8 @@ var _ChartsRadialDataProviderPremium = require("./ChartsRadialDataProviderPremiu
|
|
|
19
19
|
var _seriesConfig = require("../RadialLineChart/seriesConfig");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
const packageInfo = {
|
|
22
|
-
releaseDate: "
|
|
23
|
-
version: "9.
|
|
22
|
+
releaseDate: "MTc4Mjk1MDQwMDAwMA==",
|
|
23
|
+
version: "9.8.0",
|
|
24
24
|
name: 'x-charts-premium'
|
|
25
25
|
};
|
|
26
26
|
const defaultRadialPremiumSeriesConfig = {
|
|
@@ -12,8 +12,8 @@ import { RADIAL_PREMIUM_PLUGINS } from "./ChartsRadialDataProviderPremium.plugin
|
|
|
12
12
|
import { radialLineSeriesConfig } from "../RadialLineChart/seriesConfig/index.mjs";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const packageInfo = {
|
|
15
|
-
releaseDate: "
|
|
16
|
-
version: "9.
|
|
15
|
+
releaseDate: "MTc4Mjk1MDQwMDAwMA==",
|
|
16
|
+
version: "9.8.0",
|
|
17
17
|
name: 'x-charts-premium'
|
|
18
18
|
};
|
|
19
19
|
const defaultRadialPremiumSeriesConfig = {
|
|
@@ -5,19 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.HeatmapWebGLProgram = void 0;
|
|
7
7
|
var _utils = require("../../utils/webgl/utils");
|
|
8
|
+
var _instancedAttribute = require("../../utils/webgl/instancedAttribute");
|
|
8
9
|
var _shaders = require("./shaders");
|
|
9
|
-
const QUAD_VERTICES = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);
|
|
10
10
|
class HeatmapWebGLProgram {
|
|
11
11
|
shaders = [];
|
|
12
12
|
constructor(gl) {
|
|
13
13
|
this.gl = gl;
|
|
14
|
-
/*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
|
|
18
|
-
this.quadBuffer = gl.createBuffer();
|
|
19
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, this.quadBuffer);
|
|
20
|
-
gl.bufferData(gl.ARRAY_BUFFER, QUAD_VERTICES, gl.STATIC_DRAW);
|
|
14
|
+
/* These are global to the WebGL context and need to be set only once. */
|
|
15
|
+
(0, _utils.setupStandardBlending)(gl);
|
|
16
|
+
this.quadBuffer = (0, _utils.uploadQuadBuffer)(gl);
|
|
21
17
|
this.centers = (0, _utils.createGrowableBuffer)(gl);
|
|
22
18
|
this.colors = (0, _utils.createGrowableBuffer)(gl);
|
|
23
19
|
this.saturations = (0, _utils.createGrowableBuffer)(gl);
|
|
@@ -29,28 +25,16 @@ class HeatmapWebGLProgram {
|
|
|
29
25
|
}
|
|
30
26
|
buildVariant(fragmentShaderSource) {
|
|
31
27
|
const gl = this.gl;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const fragmentShader = (0, _utils.attachShader)(gl, program, fragmentShaderSource, gl.FRAGMENT_SHADER);
|
|
36
|
-
gl.linkProgram(program);
|
|
37
|
-
|
|
38
|
-
/* https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices#dont_check_shader_compile_status_unless_linking_fails */
|
|
39
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
-
if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
|
|
41
|
-
console.error(`Program linking failed: ${gl.getProgramInfoLog(program)}`);
|
|
42
|
-
console.error(`Vertex shader info-log: ${gl.getShaderInfoLog(vertexShader)}`);
|
|
43
|
-
console.error(`Fragment shader info-log: ${gl.getShaderInfoLog(fragmentShader)}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
this.shaders.push(vertexShader, fragmentShader);
|
|
28
|
+
const linked = (0, _utils.linkProgram)(gl, _shaders.heatmapVertexShaderSource, fragmentShaderSource);
|
|
29
|
+
this.shaders.push(...linked.shaders);
|
|
30
|
+
const program = linked.program;
|
|
47
31
|
const vao = gl.createVertexArray();
|
|
48
32
|
gl.bindVertexArray(vao);
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
(0, _utils.bindQuadBuffer)(gl, program, this.quadBuffer);
|
|
34
|
+
(0, _instancedAttribute.bindInstancedAttribute)(gl, program, 'a_center', this.centers, 2);
|
|
51
35
|
/* Colors are uploaded as Uint8(Clamped)Array; shader sees normalized [0, 1] floats. */
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
(0, _instancedAttribute.bindInstancedAttribute)(gl, program, 'a_color', this.colors, 4, gl.UNSIGNED_BYTE, true);
|
|
37
|
+
(0, _instancedAttribute.bindInstancedAttribute)(gl, program, 'a_saturation', this.saturations, 1);
|
|
54
38
|
gl.bindVertexArray(null);
|
|
55
39
|
return {
|
|
56
40
|
program,
|
|
@@ -120,13 +104,4 @@ class HeatmapWebGLProgram {
|
|
|
120
104
|
this.shaders.forEach(shader => gl.deleteShader(shader));
|
|
121
105
|
}
|
|
122
106
|
}
|
|
123
|
-
exports.HeatmapWebGLProgram = HeatmapWebGLProgram;
|
|
124
|
-
function bindAttribute(gl, program, name, buffer, size, divisor, type = gl.FLOAT, normalized = false) {
|
|
125
|
-
const location = gl.getAttribLocation(program, name);
|
|
126
|
-
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
|
127
|
-
gl.enableVertexAttribArray(location);
|
|
128
|
-
gl.vertexAttribPointer(location, size, type, normalized, 0, 0);
|
|
129
|
-
if (divisor !== 0) {
|
|
130
|
-
gl.vertexAttribDivisor(location, divisor);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
107
|
+
exports.HeatmapWebGLProgram = HeatmapWebGLProgram;
|