@holoviz/panel 0.14.0-a.24 → 0.14.0-a.26
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/bundled/css/{https:/cdnjs.cloudflare.com/ajax → ajax}/libs/font-awesome/5.15.1/css/all.min.css +0 -0
- package/dist/bundled/css/{https:/unpkg.com/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.css +0 -0
- package/dist/bundled/deckglplot/{https:/api.mapbox.com/mapbox-gl-js → mapbox-gl-js}/v2.6.1/mapbox-gl.css +0 -0
- package/dist/bundled/deckglplot/{https:/api.mapbox.com/mapbox-gl-js → mapbox-gl-js}/v2.6.1/mapbox-gl.js +0 -0
- package/dist/bundled/deckglplot/{https:/api.mapbox.com/mapbox-gl-js → mapbox-gl-js}/v2.6.1/mapbox-gl.js.map +0 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/array-pixel-blob.js +39 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-blending.js +270 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-converters.js +524 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsl.js +42 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-hsv.js +42 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-interpolation.js +133 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lab.js +47 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-lch.js +50 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-palette.js +285 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-quantization.js +135 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-rgba-64.js +95 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-scale.js +176 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/color-xyz.js +50 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/component-state-color-palette.js +113 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/histogram.js +76 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/index.js +19 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/math-utilities.js +138 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/named-colors.js +743 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/palette-extractor.js +134 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/parse-color.js +219 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-blob.js +72 -0
- package/dist/bundled/js/@microsoft/fast-colors@5.3.1/dist/pixel-box.js +249 -0
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/harness.js +33 -0
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/__test__/server.js +36 -0
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.iife.min.js +19 -0
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.js +25813 -0
- package/dist/bundled/js/@microsoft/fast-components@1.21.8/dist/fast-components.min.js +19 -0
- package/dist/bundled/js/{https:/cdnjs.cloudflare.com/ajax → ajax}/libs/react-grid-layout/1.1.1/react-grid-layout.min.js +0 -0
- package/dist/bundled/js/{https:/cdnjs.cloudflare.com/ajax → ajax}/libs/react-grid-layout/1.1.1/react-grid-layout.min.js.map +0 -0
- package/dist/bundled/js/{https:/unpkg.com/babel-standalone@latest → babel-standalone@latest}/babel.min.js +0 -0
- package/dist/bundled/js/{https:/unpkg.com/material-components-web@7.0.0 → material-components-web@7.0.0}/dist/material-components-web.min.js +0 -0
- package/dist/bundled/js/{https:/unpkg.com/react-dom@16 → react-dom@16}/umd/react-dom.development.js +0 -0
- package/dist/bundled/js/{https:/unpkg.com/react@16 → react@16}/umd/react.development.js +0 -0
- package/dist/bundled/notificationarea/{https:/cdnjs.cloudflare.com/ajax → ajax}/libs/font-awesome/5.15.1/css/all.min.css +0 -0
- package/dist/bundled/plotlyplot/{https:/cdn.plot.ly/plotly-2.10.1.min.js → plotly-2.10.1.min.js} +0 -0
- package/dist/bundled/quillinput/{https:/cdn.quilljs.com/1.3.6 → 1.3.6}/quill.bubble.css +0 -0
- package/dist/bundled/quillinput/{https:/cdn.quilljs.com/1.3.6 → 1.3.6}/quill.js +0 -0
- package/dist/bundled/quillinput/{https:/cdn.quilljs.com/1.3.6 → 1.3.6}/quill.snow.css +0 -0
- package/dist/wheels/{panel-0.14.0a24-py3-none-any.whl → panel-0.14.0a26-py3-none-any.whl} +0 -0
- package/package.json +1 -1
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ColorRGBA64 } from "./color-rgba-64.js";
|
|
2
|
+
/**
|
|
3
|
+
* Implements the PixelBlob interfaces using a a massive, ineffecient number array for pixel data. Not recomended for production use but comes in handy in unit tests or environments where creating a canvas drawing context isn't an option.
|
|
4
|
+
*/
|
|
5
|
+
export class ArrayPixelBlob {
|
|
6
|
+
/**
|
|
7
|
+
* @param image Expects a linear array of pixel data in RGBA format. Each entry should be in the range [0,255]
|
|
8
|
+
* @param width width * height * 4 must exactly equal the length of the image array
|
|
9
|
+
* @param height width * height * 4 must exactly equal the length of the image array
|
|
10
|
+
*/
|
|
11
|
+
constructor(image, width, height) {
|
|
12
|
+
this.getPixel = (x, y) => {
|
|
13
|
+
if (x < 0 || x >= this.width || y < 0 || y >= this.height) {
|
|
14
|
+
throw new Error("Requested pixel is outside of the image bounds");
|
|
15
|
+
}
|
|
16
|
+
const offset = (y * this.width + x) * 4;
|
|
17
|
+
return new ColorRGBA64(this.image[offset] / 255, this.image[offset + 1] / 255, this.image[offset + 2] / 255, this.image[offset + 3] / 255);
|
|
18
|
+
};
|
|
19
|
+
this.getPixelRGBA = (x, y) => {
|
|
20
|
+
if (x < 0 || x >= this.width || y < 0 || y >= this.height) {
|
|
21
|
+
throw new Error("Requested pixel is outside of the image bounds");
|
|
22
|
+
}
|
|
23
|
+
const offset = (y * this.width + x) * 4;
|
|
24
|
+
return [
|
|
25
|
+
this.image[offset],
|
|
26
|
+
this.image[offset + 1],
|
|
27
|
+
this.image[offset + 2],
|
|
28
|
+
this.image[offset + 3],
|
|
29
|
+
];
|
|
30
|
+
};
|
|
31
|
+
if (image.length !== 4 * width * height) {
|
|
32
|
+
throw new Error("Invalid image length for supplied width and height");
|
|
33
|
+
}
|
|
34
|
+
this.image = image;
|
|
35
|
+
this.width = width;
|
|
36
|
+
this.height = height;
|
|
37
|
+
this.totalPixels = this.width * this.height;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { hslToRGB, labToRGB, lchToRGB, rgbToHSL, rgbToLAB, rgbToLCH, } from "./color-converters.js";
|
|
2
|
+
import { ColorHSL } from "./color-hsl.js";
|
|
3
|
+
import { ColorLAB } from "./color-lab.js";
|
|
4
|
+
import { ColorLCH } from "./color-lch.js";
|
|
5
|
+
import { ColorRGBA64 } from "./color-rgba-64.js";
|
|
6
|
+
import { clamp } from "./math-utilities.js";
|
|
7
|
+
/**
|
|
8
|
+
* Saturate a color using LCH color space
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* The alpha channel of the input is ignored
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export function saturateViaLCH(input, saturation, saturationConstant = 18) {
|
|
16
|
+
const lch = rgbToLCH(input);
|
|
17
|
+
let sat = lch.c + saturation * saturationConstant;
|
|
18
|
+
if (sat < 0) {
|
|
19
|
+
sat = 0;
|
|
20
|
+
}
|
|
21
|
+
return lchToRGB(new ColorLCH(lch.l, sat, lch.h));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* De-saturate a color using LCH color space
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* The alpha channel of the input is ignored
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export function desaturateViaLCH(input, saturation, saturationConstant = 18) {
|
|
32
|
+
return saturateViaLCH(input, -1 * saturation, saturationConstant);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Darken a color using LAB color space
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* The alpha channel of the input is ignored
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export function darkenViaLAB(input, amount, darkenConstant = 18) {
|
|
43
|
+
const lab = rgbToLAB(input);
|
|
44
|
+
const darkened = lab.l - amount * darkenConstant;
|
|
45
|
+
return labToRGB(new ColorLAB(darkened, lab.a, lab.b));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Lighten a color using LAB color space
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* The alpha channel of the input is ignored
|
|
52
|
+
*
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
export function lightenViaLAB(input, amount, darkenConstant = 18) {
|
|
56
|
+
return darkenViaLAB(input, -1 * amount, darkenConstant);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* @public
|
|
60
|
+
*/
|
|
61
|
+
export function blendBurnChannel(bottom, top) {
|
|
62
|
+
if (top === 0.0) {
|
|
63
|
+
// Despite the discontinuity, other sources seem to use 0.0 here instead of 1
|
|
64
|
+
return 0.0;
|
|
65
|
+
}
|
|
66
|
+
return 1.0 - (1.0 - bottom) / top;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Blends two colors with the burn mode
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* The alpha channel of the input is ignored
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
export function blendBurn(bottom, top) {
|
|
77
|
+
return new ColorRGBA64(blendBurnChannel(bottom.r, top.r), blendBurnChannel(bottom.g, top.g), blendBurnChannel(bottom.b, top.b), 1);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Blends two colors
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* The alpha channel of the input is ignored
|
|
84
|
+
*
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
export function blendColor(bottom, top) {
|
|
88
|
+
const bottomHSL = rgbToHSL(bottom);
|
|
89
|
+
const topHSL = rgbToHSL(top);
|
|
90
|
+
if (topHSL.s === 0) {
|
|
91
|
+
return new ColorRGBA64(bottomHSL.l, bottomHSL.l, bottomHSL.l, 1);
|
|
92
|
+
}
|
|
93
|
+
return hslToRGB(new ColorHSL(topHSL.h, topHSL.s, bottomHSL.l));
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export function blendDarkenChannel(bottom, top) {
|
|
99
|
+
return Math.min(bottom, top);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Blends two colors with the darken mode
|
|
103
|
+
*
|
|
104
|
+
* @remarks
|
|
105
|
+
* The alpha channel of the input is ignored
|
|
106
|
+
*
|
|
107
|
+
* @public
|
|
108
|
+
*/
|
|
109
|
+
export function blendDarken(bottom, top) {
|
|
110
|
+
return new ColorRGBA64(blendDarkenChannel(bottom.r, top.r), blendDarkenChannel(bottom.g, top.g), blendDarkenChannel(bottom.b, top.b), 1);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
export function blendDodgeChannel(bottom, top) {
|
|
116
|
+
if (top >= 1.0) {
|
|
117
|
+
return 1.0;
|
|
118
|
+
}
|
|
119
|
+
const retVal = bottom / (1.0 - top);
|
|
120
|
+
if (retVal >= 1.0) {
|
|
121
|
+
return 1.0;
|
|
122
|
+
}
|
|
123
|
+
return retVal;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Blends two colors with the dodge mode
|
|
127
|
+
*
|
|
128
|
+
* @remarks
|
|
129
|
+
* The alpha channel of the input is ignored
|
|
130
|
+
*
|
|
131
|
+
* @public
|
|
132
|
+
*/
|
|
133
|
+
export function blendDodge(bottom, top) {
|
|
134
|
+
return new ColorRGBA64(blendDodgeChannel(bottom.r, top.r), blendDodgeChannel(bottom.g, top.g), blendDodgeChannel(bottom.b, top.b), 1);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
export function blendLightenChannel(bottom, top) {
|
|
140
|
+
return Math.max(bottom, top);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Blends two colors with the lighten mode
|
|
144
|
+
*
|
|
145
|
+
* @remarks
|
|
146
|
+
* The alpha channel of the input is ignored
|
|
147
|
+
*
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
export function blendLighten(bottom, top) {
|
|
151
|
+
return new ColorRGBA64(blendLightenChannel(bottom.r, top.r), blendLightenChannel(bottom.g, top.g), blendLightenChannel(bottom.b, top.b), 1);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export function blendMultiplyChannel(bottom, top) {
|
|
157
|
+
return bottom * top;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Blends two colors with the multiply mode
|
|
161
|
+
*
|
|
162
|
+
* @remarks
|
|
163
|
+
* The alpha channel of the input is ignored
|
|
164
|
+
*
|
|
165
|
+
* @public
|
|
166
|
+
*/
|
|
167
|
+
export function blendMultiply(bottom, top) {
|
|
168
|
+
return new ColorRGBA64(blendMultiplyChannel(bottom.r, top.r), blendMultiplyChannel(bottom.g, top.g), blendMultiplyChannel(bottom.b, top.b), 1);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
export function blendOverlayChannel(bottom, top) {
|
|
174
|
+
if (bottom < 0.5) {
|
|
175
|
+
return clamp(2.0 * top * bottom, 0, 1);
|
|
176
|
+
}
|
|
177
|
+
return clamp(1.0 - 2.0 * (1.0 - top) * (1.0 - bottom), 0, 1);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Blends two colors with the overlay mode
|
|
181
|
+
*
|
|
182
|
+
* @remarks
|
|
183
|
+
* The alpha channel of the input is ignored
|
|
184
|
+
*
|
|
185
|
+
* @public
|
|
186
|
+
*/
|
|
187
|
+
export function blendOverlay(bottom, top) {
|
|
188
|
+
return new ColorRGBA64(blendOverlayChannel(bottom.r, top.r), blendOverlayChannel(bottom.g, top.g), blendOverlayChannel(bottom.b, top.b), 1);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* @public
|
|
192
|
+
*/
|
|
193
|
+
export function blendScreenChannel(bottom, top) {
|
|
194
|
+
return 1.0 - (1.0 - top) * (1.0 - bottom);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Blends two colors with the screen mode
|
|
198
|
+
*
|
|
199
|
+
* @remarks
|
|
200
|
+
* The alpha channel of the input is ignored
|
|
201
|
+
*
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
export function blendScreen(bottom, top) {
|
|
205
|
+
return new ColorRGBA64(blendScreenChannel(bottom.r, top.r), blendScreenChannel(bottom.g, top.g), blendScreenChannel(bottom.b, top.b), 1);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Color blend modes.
|
|
209
|
+
* @public
|
|
210
|
+
*/
|
|
211
|
+
export var ColorBlendMode;
|
|
212
|
+
(function (ColorBlendMode) {
|
|
213
|
+
ColorBlendMode[ColorBlendMode["Burn"] = 0] = "Burn";
|
|
214
|
+
ColorBlendMode[ColorBlendMode["Color"] = 1] = "Color";
|
|
215
|
+
ColorBlendMode[ColorBlendMode["Darken"] = 2] = "Darken";
|
|
216
|
+
ColorBlendMode[ColorBlendMode["Dodge"] = 3] = "Dodge";
|
|
217
|
+
ColorBlendMode[ColorBlendMode["Lighten"] = 4] = "Lighten";
|
|
218
|
+
ColorBlendMode[ColorBlendMode["Multiply"] = 5] = "Multiply";
|
|
219
|
+
ColorBlendMode[ColorBlendMode["Overlay"] = 6] = "Overlay";
|
|
220
|
+
ColorBlendMode[ColorBlendMode["Screen"] = 7] = "Screen";
|
|
221
|
+
})(ColorBlendMode || (ColorBlendMode = {}));
|
|
222
|
+
/**
|
|
223
|
+
* Blend two colors.
|
|
224
|
+
*
|
|
225
|
+
* @remarks
|
|
226
|
+
* The alpha channel of the input is ignored
|
|
227
|
+
*
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
export function blend(mode, bottom, top) {
|
|
231
|
+
switch (mode) {
|
|
232
|
+
case ColorBlendMode.Burn:
|
|
233
|
+
return blendBurn(bottom, top);
|
|
234
|
+
case ColorBlendMode.Color:
|
|
235
|
+
return blendColor(bottom, top);
|
|
236
|
+
case ColorBlendMode.Darken:
|
|
237
|
+
return blendDarken(bottom, top);
|
|
238
|
+
case ColorBlendMode.Dodge:
|
|
239
|
+
return blendDodge(bottom, top);
|
|
240
|
+
case ColorBlendMode.Lighten:
|
|
241
|
+
return blendLighten(bottom, top);
|
|
242
|
+
case ColorBlendMode.Multiply:
|
|
243
|
+
return blendMultiply(bottom, top);
|
|
244
|
+
case ColorBlendMode.Overlay:
|
|
245
|
+
return blendOverlay(bottom, top);
|
|
246
|
+
case ColorBlendMode.Screen:
|
|
247
|
+
return blendScreen(bottom, top);
|
|
248
|
+
default:
|
|
249
|
+
throw new Error("Unknown blend mode");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Alpha channel of bottom is ignored
|
|
254
|
+
* The returned color always has an alpha channel of 1
|
|
255
|
+
* Different programs (eg: paint.net, photoshop) will give different answers than this occasionally but within +/- 1/255 in each channel. Just depends on the details of how they round off decimals
|
|
256
|
+
*
|
|
257
|
+
* @public
|
|
258
|
+
*/
|
|
259
|
+
export function computeAlphaBlend(bottom, top) {
|
|
260
|
+
if (top.a >= 1) {
|
|
261
|
+
return top;
|
|
262
|
+
}
|
|
263
|
+
else if (top.a <= 0) {
|
|
264
|
+
return new ColorRGBA64(bottom.r, bottom.g, bottom.b, 1);
|
|
265
|
+
}
|
|
266
|
+
const r = top.a * top.r + (1 - top.a) * bottom.r;
|
|
267
|
+
const g = top.a * top.g + (1 - top.a) * bottom.g;
|
|
268
|
+
const b = top.a * top.b + (1 - top.a) * bottom.b;
|
|
269
|
+
return new ColorRGBA64(r, g, b, 1);
|
|
270
|
+
}
|