vis-core 0.13.5 → 0.13.7

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.
@@ -41145,7 +41145,7 @@ function Bl(n) {
41145
41145
  const t = new qt();
41146
41146
  return t.color.setScalar(n), t;
41147
41147
  }
41148
- const pX = "0.13.5", o1 = !1;
41148
+ const pX = "0.13.7", o1 = !1;
41149
41149
  class Na {
41150
41150
  constructor(t, e = {}) {
41151
41151
  D(this, "container");
@@ -42239,84 +42239,85 @@ const DI = {
42239
42239
  });
42240
42240
  }
42241
42241
  setAreaMixColor(e, i) {
42242
- const s = this.setAreaColorByProperty("adcode", e, i);
42243
- s && (s.color.set("#ffffff"), s.onBeforeCompile = (l) => {
42244
- l.uniforms.c = {
42245
- value: new rt(i)
42246
- }, l.fragmentShader = `
42247
- uniform vec3 c;
42248
- vec3 rgb2hsv(float r, float g, float b) {
42249
- vec3 c = vec3(r, g, b);
42250
- vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
42251
- vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
42252
- vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
42253
-
42254
- float d = q.x - min(q.w, q.y);
42255
- float e = 1.0e-10;
42256
- return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
42257
- }
42258
-
42259
- vec3 hsv2rgb( float h, float s, float v ) {
42260
- vec3 c = vec3(h, s, v);
42261
- vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
42262
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
42263
- return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
42264
- }
42265
-
42266
- vec3 adjustBrightnessContrast(vec3 color, float brightness, float contrast) {
42267
- color = color * brightness;
42268
- color = (color - 0.5) * contrast + 0.5;
42269
- return clamp(color, 0.0, 1.0);
42270
- }
42271
-
42272
- float contrast(float value, float contrast) {
42273
- return (value - 0.5) * contrast + 0.5;
42274
- }
42275
-
42276
- float contrast2(float value, float contrast, float center) {
42277
- return (value - center) * contrast + center;
42278
- }
42279
-
42280
- vec3 adjustBrightness(vec3 color, float brightness) {
42281
- float factor = 0.4 * brightness * brightness + 0.6 * brightness;
42282
- return clamp(color * factor, 0.0, 1.0);
42283
- }
42284
-
42285
- ${l.fragmentShader}
42286
- `.replace(
42287
- "#include <dithering_fragment>",
42288
- `#include <dithering_fragment>
42289
- vec4 _i_50_rgb = gl_FragColor;
42290
- float alpha = 1.0;
42291
- vec3 _i_51_hsv = rgb2hsv(_i_50_rgb.r, _i_50_rgb.g, _i_50_rgb.b);
42292
- vec3 _i_52_rgb = hsv2rgb(_i_51_hsv.r, _i_51_hsv.g, _i_51_hsv.b);
42242
+ this.setAreaColorByProperty("adcode", e, i, !0);
42243
+ }
42244
+ setAreaColorByProperty(e, i, s, l = !1) {
42245
+ if (!this.map)
42246
+ return;
42247
+ const a = this.map.areaArr.find((o) => o.userData[e] === i);
42248
+ if (a) {
42249
+ const o = this.map.setAreaColor(a, s);
42250
+ l && o && (o.color.set("#ffffff"), o.onBeforeCompile = (c) => {
42251
+ c.uniforms.c = {
42252
+ value: new rt(s)
42253
+ }, c.fragmentShader = `
42254
+ uniform vec3 c;
42255
+ vec3 rgb2hsv(float r, float g, float b) {
42256
+ vec3 c = vec3(r, g, b);
42257
+ vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
42258
+ vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
42259
+ vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
42293
42260
 
42294
- float alphas = _i_52_rgb.b * 0.6;
42295
- alphas *= 0.8;
42296
- alphas *= mix(1.5, 1.9, alphas);
42297
- alphas += (1.0 - alphas) * 0.25;
42261
+ float d = q.x - min(q.w, q.y);
42262
+ float e = 1.0e-10;
42263
+ return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
42264
+ }
42298
42265
 
42299
- float endC = 1.0;
42300
- alphas = mix(0.3, endC, alphas / endC);
42301
- alphas = mix(alphas, alphas, step(endC, alphas));
42302
- alphas = contrast(alphas, 1.4);
42303
- alphas = contrast2(alphas, 1.5, 0.9);
42266
+ vec3 hsv2rgb( float h, float s, float v ) {
42267
+ vec3 c = vec3(h, s, v);
42268
+ vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
42269
+ vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
42270
+ return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
42271
+ }
42272
+
42273
+ vec3 adjustBrightnessContrast(vec3 color, float brightness, float contrast) {
42274
+ color = color * brightness;
42275
+ color = (color - 0.5) * contrast + 0.5;
42276
+ return clamp(color, 0.0, 1.0);
42277
+ }
42278
+
42279
+ float contrast(float value, float contrast) {
42280
+ return (value - 0.5) * contrast + 0.5;
42281
+ }
42282
+
42283
+ float contrast2(float value, float contrast, float center) {
42284
+ return (value - center) * contrast + center;
42285
+ }
42286
+
42287
+ vec3 adjustBrightness(vec3 color, float brightness) {
42288
+ float factor = 0.4 * brightness * brightness + 0.6 * brightness;
42289
+ return clamp(color * factor, 0.0, 1.0);
42290
+ }
42304
42291
 
42305
- vec3 chsv = rgb2hsv(c.r, c.g, c.b);
42306
- vec3 ccccc = hsv2rgb(chsv.r, chsv.g - 0.2, alphas - 0.27);
42307
- gl_FragColor = vec4(ccccc, alpha * 0.65);
42308
-
42292
+ ${c.fragmentShader}
42293
+ `.replace(
42294
+ "#include <dithering_fragment>",
42295
+ `#include <dithering_fragment>
42296
+ vec4 _i_50_rgb = gl_FragColor;
42297
+ float alpha = 1.0;
42298
+ vec3 _i_51_hsv = rgb2hsv(_i_50_rgb.r, _i_50_rgb.g, _i_50_rgb.b);
42299
+ vec3 _i_52_rgb = hsv2rgb(_i_51_hsv.r, _i_51_hsv.g, _i_51_hsv.b);
42300
+
42301
+ float alphas = _i_52_rgb.b * 0.6;
42302
+ alphas *= 0.8;
42303
+ alphas *= mix(1.5, 1.9, alphas);
42304
+ alphas += (1.0 - alphas) * 0.25;
42305
+
42306
+ float endC = 1.0;
42307
+ alphas = mix(0.3, endC, alphas / endC);
42308
+ alphas = mix(alphas, alphas, step(endC, alphas));
42309
+ alphas = contrast(alphas, 1.4);
42310
+ alphas = contrast2(alphas, 1.5, 0.9);
42311
+
42312
+ vec3 chsv = rgb2hsv(c.r, c.g, c.b);
42313
+ vec3 ccccc = hsv2rgb(chsv.r, chsv.g - 0.2, alphas - 0.27);
42314
+ gl_FragColor = vec4(ccccc, alpha * 0.65);
42309
42315
 
42310
- `
42311
- );
42312
- }, s.needsUpdate = !0);
42313
- }
42314
- setAreaColorByProperty(e, i, s) {
42315
- if (!this.map)
42316
- return;
42317
- const l = this.map.areaArr.find((a) => a.userData[e] === i);
42318
- if (l)
42319
- return this.map.setAreaColor(l, s);
42316
+
42317
+ `
42318
+ );
42319
+ }, o.needsUpdate = !0);
42320
+ }
42320
42321
  }
42321
42322
  addAreaPlaneByProperty(l, a) {
42322
42323
  return Zt(this, arguments, function* (e, i, s = {}) {
@@ -46860,6 +46861,7 @@ class L8 {
46860
46861
  }
46861
46862
  }
46862
46863
  export {
46864
+ Te as MeshLineMaterial,
46863
46865
  Yh as THREE,
46864
46866
  L8 as default,
46865
46867
  R8 as visConfig
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.13.5";
1
+ declare const _default: "0.13.7";
2
2
  export default _default;
@@ -105,7 +105,7 @@ export default class extends Base {
105
105
  loaderAdd(adcode: number): void;
106
106
  initMaterial(adcode: number): Promise<void>;
107
107
  setAreaMixColor(adcode: number, color: string): void;
108
- setAreaColorByProperty(key: string, value: any, color: string): THREE.MeshStandardMaterial | undefined;
108
+ setAreaColorByProperty(key: string, value: any, color: string, mix?: boolean): void;
109
109
  addAreaPlaneByProperty(key: string, value: any, options?: {
110
110
  material?: THREE.Material;
111
111
  lineMaterial?: MeshLineMaterial;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.13.5",
3
+ "version": "0.13.7",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",