scichart-engine 1.0.0 → 1.0.1

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.
@@ -3,6 +3,7 @@ import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Tooltip3DOptions } from './Tooltip3D';
5
5
  import { Renderer3DOptions, RenderStats3D, Renderer3DEventCallback } from './types';
6
+ import { CustomThemeOptions } from './colorThemes';
6
7
 
7
8
  export interface AreaSeriesData {
8
9
  /** X coordinates */
@@ -28,6 +29,8 @@ export interface Area3DRendererOptions extends Renderer3DOptions {
28
29
  /** Enable tooltips (default: true) */
29
30
  enableTooltip?: boolean;
30
31
  tooltip?: Tooltip3DOptions;
32
+ /** Color theme options */
33
+ theme?: CustomThemeOptions;
31
34
  }
32
35
  export declare class Area3DRenderer {
33
36
  private canvas;
@@ -51,6 +54,8 @@ export declare class Area3DRenderer {
51
54
  private animationFrameId;
52
55
  private needsRender;
53
56
  private eventListeners;
57
+ private hoveredSeriesIndex;
58
+ private colorTheme;
54
59
  private tooltip;
55
60
  private enableTooltip;
56
61
  private lastHitIndex;
@@ -4,6 +4,7 @@ import { Axes3DOptions } from './Axes3D';
4
4
  import { Ray3D, HitResult } from './Raycaster3D';
5
5
  import { Bubble3DData, Bubble3DStyle, Renderer3DOptions, RenderStats3D, Renderer3DEventCallback } from './types';
6
6
  import { Tooltip3DOptions, Tooltip3DData } from './Tooltip3D';
7
+ import { CustomThemeOptions } from './colorThemes';
7
8
 
8
9
  export interface Bubble3DRendererOptions extends Renderer3DOptions {
9
10
  camera?: OrbitCameraOptions;
@@ -20,6 +21,8 @@ export interface Bubble3DRendererOptions extends Renderer3DOptions {
20
21
  tooltip?: Tooltip3DOptions;
21
22
  /** Custom tooltip formatter */
22
23
  tooltipFormatter?: (data: Tooltip3DData) => string;
24
+ /** Color theme options */
25
+ theme?: CustomThemeOptions;
23
26
  }
24
27
  export declare class Bubble3DRenderer {
25
28
  private canvas;
@@ -48,6 +51,7 @@ export declare class Bubble3DRenderer {
48
51
  private frameCount;
49
52
  private fps;
50
53
  private lastFpsUpdate;
54
+ private colorTheme;
51
55
  constructor(options: Bubble3DRendererOptions);
52
56
  private handleMouseMove;
53
57
  private handleMouseLeave;
@@ -3,6 +3,7 @@ import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Tooltip3DOptions } from './Tooltip3D';
5
5
  import { Renderer3DOptions, RenderStats3D, Renderer3DEventCallback } from './types';
6
+ import { CustomThemeOptions } from './colorThemes';
6
7
 
7
8
  export interface ImpulseSeriesData {
8
9
  /** X coordinates */
@@ -34,6 +35,8 @@ export interface Impulse3DRendererOptions extends Renderer3DOptions {
34
35
  /** Enable tooltips (default: true) */
35
36
  enableTooltip?: boolean;
36
37
  tooltip?: Tooltip3DOptions;
38
+ /** Color theme options */
39
+ theme?: CustomThemeOptions;
37
40
  }
38
41
  export declare class Impulse3DRenderer {
39
42
  private canvas;
@@ -75,6 +78,7 @@ export declare class Impulse3DRenderer {
75
78
  private frameCount;
76
79
  private fps;
77
80
  private lastFpsUpdate;
81
+ private colorTheme;
78
82
  constructor(options: Impulse3DRendererOptions);
79
83
  private handleMouseMove;
80
84
  private handleMouseLeave;
@@ -2,6 +2,7 @@ import { OrbitCameraOptions } from './camera/OrbitCamera';
2
2
  import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Renderer3DOptions, Renderer3DEventCallback } from './types';
5
+ import { CustomThemeOptions } from './colorThemes';
5
6
 
6
7
  export interface PointCloudData {
7
8
  /** Positions [x0, y0, z0, x1, y1, z1, ...] */
@@ -16,12 +17,14 @@ export interface PointCloud3DRendererOptions extends Renderer3DOptions {
16
17
  controls?: OrbitControllerOptions;
17
18
  axes?: Axes3DOptions;
18
19
  showAxes?: boolean;
19
- /** Global point size multiplier (default: 1.0) */
20
+ /** Global point size multiplier (default: 2.0) */
20
21
  pointSize?: number;
21
22
  /** Use circular points instead of squares (default: true) */
22
23
  circular?: boolean;
23
24
  /** Global opacity (default: 1.0) */
24
25
  opacity?: number;
26
+ /** Color theme options */
27
+ theme?: CustomThemeOptions;
25
28
  /** Enable tooltips */
26
29
  enableTooltip?: boolean;
27
30
  }
@@ -51,10 +54,12 @@ export declare class PointCloud3DRenderer {
51
54
  private lastHitIndex;
52
55
  private boundHandleMouseMove?;
53
56
  private boundHandleMouseLeave?;
57
+ private colorTheme;
54
58
  constructor(options: PointCloud3DRendererOptions);
55
59
  private initBuffers;
56
60
  setData(data: PointCloudData): void;
57
61
  private updateBounds;
62
+ private generateThemeColors;
58
63
  render(): void;
59
64
  private startRenderLoop;
60
65
  fitToData(): void;
@@ -2,6 +2,7 @@ import { OrbitCameraOptions } from './camera/OrbitCamera';
2
2
  import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Renderer3DOptions, Renderer3DEventCallback } from './types';
5
+ import { CustomThemeOptions } from './colorThemes';
5
6
 
6
7
  export interface RibbonSeriesData {
7
8
  /** X coordinates */
@@ -24,6 +25,8 @@ export interface Ribbon3DRendererOptions extends Renderer3DOptions {
24
25
  opacity?: number;
25
26
  /** Enable tooltips */
26
27
  enableTooltip?: boolean;
28
+ /** Color theme options */
29
+ theme?: CustomThemeOptions;
27
30
  }
28
31
  export declare class Ribbon3DRenderer {
29
32
  private canvas;
@@ -46,6 +49,8 @@ export declare class Ribbon3DRenderer {
46
49
  private animationFrameId;
47
50
  private needsRender;
48
51
  private eventListeners;
52
+ private hoveredSeriesIndex;
53
+ private colorTheme;
49
54
  private tooltip;
50
55
  private lastHitIndex;
51
56
  private boundHandleMouseMove?;
@@ -2,6 +2,7 @@ import { OrbitCameraOptions } from './camera/OrbitCamera';
2
2
  import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Renderer3DOptions, Renderer3DEventCallback } from './types';
5
+ import { CustomThemeOptions } from './colorThemes';
5
6
 
6
7
  export interface SurfaceBarData {
7
8
  /** Number of rows in the grid (Z axis) */
@@ -22,10 +23,12 @@ export interface SurfaceBar3DRendererOptions extends Renderer3DOptions {
22
23
  controls?: OrbitControllerOptions;
23
24
  axes?: Axes3DOptions;
24
25
  showAxes?: boolean;
25
- /** Bar width scale relative to spacing (0.0 to 1.0, default 0.8) */
26
- barScale?: number;
27
- /** Global opacity (default: 1.0) */
26
+ /** Opacity (default: 1.0) */
28
27
  opacity?: number;
28
+ /** Bar scale (default: 1.0) */
29
+ barScale?: number;
30
+ /** Color theme options */
31
+ theme?: CustomThemeOptions;
29
32
  /** Enable tooltips */
30
33
  enableTooltip?: boolean;
31
34
  }
@@ -59,10 +62,12 @@ export declare class SurfaceBar3DRenderer {
59
62
  private lastHitIndex;
60
63
  private boundHandleMouseMove?;
61
64
  private boundHandleMouseLeave?;
65
+ private colorTheme;
62
66
  constructor(options: SurfaceBar3DRendererOptions);
63
67
  private initBuffers;
64
68
  setData(data: SurfaceBarData): void;
65
69
  private updateBounds;
70
+ private generateThemeColors;
66
71
  render(): void;
67
72
  private startRenderLoop;
68
73
  fitToData(): void;
@@ -2,6 +2,7 @@ import { OrbitCameraOptions } from './camera/OrbitCamera';
2
2
  import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Renderer3DOptions, Renderer3DEventCallback } from './types';
5
+ import { CustomThemeOptions } from './colorThemes';
5
6
 
6
7
  export interface VectorFieldData {
7
8
  /** Origin positions [x0, y0, z0, x1, y1, z1, ...] */
@@ -20,8 +21,10 @@ export interface VectorField3DRendererOptions extends Renderer3DOptions {
20
21
  showAxes?: boolean;
21
22
  /** Arrow scale multiplier (default: 1.0) */
22
23
  scaleMultiplier?: number;
23
- /** Opacity (default: 1.0) */
24
+ /** Opacity for arrows (default: 0.9) */
24
25
  opacity?: number;
26
+ /** Color theme options */
27
+ theme?: CustomThemeOptions;
25
28
  /** Enable tooltips */
26
29
  enableTooltip?: boolean;
27
30
  }
@@ -54,6 +57,7 @@ export declare class VectorField3DRenderer {
54
57
  private lastHitIndex;
55
58
  private boundHandleMouseMove?;
56
59
  private boundHandleMouseLeave?;
60
+ private colorTheme;
57
61
  constructor(options: VectorField3DRendererOptions);
58
62
  private initArrowGeometry;
59
63
  setData(data: VectorFieldData): void;
@@ -2,6 +2,7 @@ import { OrbitCameraOptions } from './camera/OrbitCamera';
2
2
  import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Renderer3DOptions, Renderer3DEventCallback } from './types';
5
+ import { CustomThemeOptions } from './colorThemes';
5
6
 
6
7
  export interface VoxelData {
7
8
  /** Dimensions of the 3D grid [nx, ny, nz] */
@@ -28,6 +29,8 @@ export interface Voxel3DRendererOptions extends Renderer3DOptions {
28
29
  opacity?: number;
29
30
  /** Enable tooltips */
30
31
  enableTooltip?: boolean;
32
+ /** Color theme options */
33
+ theme?: CustomThemeOptions;
31
34
  }
32
35
  export declare class Voxel3DRenderer {
33
36
  private canvas;
@@ -2,6 +2,7 @@ import { OrbitCameraOptions } from './camera/OrbitCamera';
2
2
  import { OrbitControllerOptions } from './controls/OrbitController';
3
3
  import { Axes3DOptions } from './Axes3D';
4
4
  import { Renderer3DOptions, Renderer3DEventCallback } from './types';
5
+ import { CustomThemeOptions } from './colorThemes';
5
6
 
6
7
  export interface WaterfallSeriesData {
7
8
  /** Y values for this slice */
@@ -26,6 +27,8 @@ export interface Waterfall3DRendererOptions extends Renderer3DOptions {
26
27
  opacity?: number;
27
28
  /** Enable tooltips */
28
29
  enableTooltip?: boolean;
30
+ /** Color theme options */
31
+ theme?: CustomThemeOptions;
29
32
  }
30
33
  export declare class Waterfall3DRenderer {
31
34
  private canvas;
@@ -37,6 +40,7 @@ export declare class Waterfall3DRenderer {
37
40
  private axes;
38
41
  private vao;
39
42
  private positionBuffer;
43
+ private normalBuffer;
40
44
  private colorBuffer;
41
45
  private indexBuffer;
42
46
  private indexCount;
@@ -50,6 +54,8 @@ export declare class Waterfall3DRenderer {
50
54
  private animationFrameId;
51
55
  private needsRender;
52
56
  private eventListeners;
57
+ private hoveredSeriesIndex;
58
+ private colorTheme;
53
59
  private tooltip;
54
60
  private lastHitIndex;
55
61
  private boundHandleMouseMove?;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Color palettes and themes for 3D charts
3
+ * Provides optimized color schemes for both dark and light backgrounds
4
+ */
5
+ export type ColorPalette = Array<[number, number, number]>;
6
+ export interface ColorTheme {
7
+ /** Series color palette */
8
+ seriesPalette: ColorPalette;
9
+ /** Highlight color for hover states */
10
+ highlightColor: [number, number, number];
11
+ /** Default background color */
12
+ backgroundColor?: [number, number, number, number];
13
+ }
14
+ /**
15
+ * Dark theme - optimized for dark backgrounds
16
+ * Uses vibrant, saturated colors that pop against dark backgrounds
17
+ */
18
+ export declare const DARK_THEME: ColorTheme;
19
+ /**
20
+ * Light theme - optimized for light backgrounds
21
+ * Uses deeper, more saturated colors that stand out against white/light backgrounds
22
+ */
23
+ export declare const LIGHT_THEME: ColorTheme;
24
+ /**
25
+ * Auto-detect theme based on background color luminance
26
+ */
27
+ export declare function getThemeFromBackground(backgroundColor: [number, number, number, number]): ColorTheme;
28
+ /**
29
+ * Create a custom theme or merge with defaults
30
+ */
31
+ export interface CustomThemeOptions {
32
+ /** Custom series palette (overrides default) */
33
+ seriesPalette?: ColorPalette;
34
+ /** Custom highlight color (overrides default) */
35
+ highlightColor?: [number, number, number];
36
+ /** Base theme to use ('dark' | 'light' | 'auto') */
37
+ baseTheme?: 'dark' | 'light' | 'auto';
38
+ }
39
+ export declare function createTheme(options: CustomThemeOptions, backgroundColor?: [number, number, number, number]): ColorTheme;
@@ -1,41 +1,8 @@
1
- /**
2
- * 3D Rendering Module for scichart-engine
3
- *
4
- * Lightweight WebGL2-based 3D bubble chart renderer with:
5
- * - Instanced rendering for 100k+ bubbles in single draw call
6
- * - Orbit camera with mouse/touch controls
7
- * - No external dependencies (custom math library)
8
- *
9
- * @example
10
- * ```typescript
11
- * import { Bubble3DRenderer } from 'scichart-engine/core/3d';
12
- *
13
- * const renderer = new Bubble3DRenderer({
14
- * canvas: document.getElementById('canvas') as HTMLCanvasElement,
15
- * });
16
- *
17
- * // Set data (10k bubbles)
18
- * const count = 10000;
19
- * const positions = new Float32Array(count * 3);
20
- * const colors = new Float32Array(count * 3);
21
- * const scales = new Float32Array(count);
22
- *
23
- * for (let i = 0; i < count; i++) {
24
- * positions[i * 3] = Math.random() * 10 - 5;
25
- * positions[i * 3 + 1] = Math.random() * 10 - 5;
26
- * positions[i * 3 + 2] = Math.random() * 10 - 5;
27
- * colors[i * 3] = Math.random();
28
- * colors[i * 3 + 1] = Math.random();
29
- * colors[i * 3 + 2] = Math.random();
30
- * scales[i] = 0.05 + Math.random() * 0.1;
31
- * }
32
- *
33
- * renderer.setData({ positions, colors, scales });
34
- * renderer.fitToData();
35
- * ```
36
- */
37
1
  export { Bubble3DRenderer, type Bubble3DRendererOptions } from './Bubble3DRenderer';
38
2
  export { SurfaceMesh3DRenderer, type SurfaceMesh3DRendererOptions } from './SurfaceMesh3DRenderer';
3
+ export * from './colorThemes';
4
+ export type { ColorTheme, ColorPalette, CustomThemeOptions } from './colorThemes';
5
+ export { DARK_THEME, LIGHT_THEME, getThemeFromBackground, createTheme } from './colorThemes';
39
6
  export { Line3DRenderer, type Line3DRendererOptions, type Line3DData } from './Line3DRenderer';
40
7
  export { Area3DRenderer, type Area3DRendererOptions, type AreaSeriesData } from './Area3DRenderer';
41
8
  export { Impulse3DRenderer, type Impulse3DRendererOptions, type ImpulseSeriesData } from './Impulse3DRenderer';
@@ -13,15 +13,15 @@ export declare const SURFACE_VERT = "#version 300 es\nprecision highp float;\n\n
13
13
  export declare const SURFACE_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin vec3 v_normal;\nin vec3 v_worldPos;\n\nuniform float u_opacity;\nuniform vec3 u_lightDir;\nuniform float u_ambient;\n\nout vec4 fragColor;\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n vec3 lightDir = normalize(u_lightDir);\n \n float diff = max(dot(normal, lightDir), 0.0);\n float lighting = u_ambient + (1.0 - u_ambient) * diff;\n \n vec3 color = v_color * lighting;\n fragColor = vec4(color, u_opacity);\n}\n";
14
14
  export declare const LINE_POINT_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position;\nin vec3 a_color;\n\nuniform mat4 u_viewProjection;\nuniform float u_pointSize;\n\nout vec3 v_color;\n\nvoid main() {\n gl_Position = u_viewProjection * vec4(a_position, 1.0);\n gl_PointSize = u_pointSize;\n v_color = a_color;\n}\n";
15
15
  export declare const LINE_POINT_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nuniform float u_opacity;\n\nout vec4 fragColor;\n\nvoid main() {\n fragColor = vec4(v_color, u_opacity);\n}\n";
16
- export declare const WATERFALL_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position;\nin vec3 a_color;\n\nuniform mat4 u_viewProjection;\n\nout vec3 v_color;\nout float v_depth;\n\nvoid main() {\n gl_Position = u_viewProjection * vec4(a_position, 1.0);\n v_color = a_color;\n v_depth = a_position.z;\n}\n";
17
- export declare const WATERFALL_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin float v_depth;\n\nuniform float u_opacity;\nuniform float u_fadeStart;\nuniform float u_fadeEnd;\n\nout vec4 fragColor;\n\nvoid main() {\n // Fade based on depth (Z position)\n float fade = 1.0;\n if (u_fadeEnd > u_fadeStart) {\n fade = 1.0 - smoothstep(u_fadeStart, u_fadeEnd, v_depth);\n }\n \n fragColor = vec4(v_color, u_opacity * fade);\n}\n";
16
+ export declare const WATERFALL_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\n\nuniform mat4 u_viewProjection;\n\nout vec3 v_color;\nout float v_depth;\nout vec3 v_normal;\n\nvoid main() {\n gl_Position = u_viewProjection * vec4(a_position, 1.0);\n v_color = a_color;\n v_depth = a_position.z;\n v_normal = a_normal;\n}\n";
17
+ export declare const WATERFALL_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin float v_depth;\nin vec3 v_normal;\n\nuniform float u_opacity;\nuniform float u_fadeStart;\nuniform float u_fadeEnd;\nuniform vec3 u_lightDir;\nuniform float u_ambient;\n\nout vec4 fragColor;\n\nvoid main() {\n // Lighting\n vec3 normal = normalize(v_normal);\n vec3 lightDir = normalize(u_lightDir);\n float diff = max(dot(normal, lightDir), 0.0);\n float lighting = u_ambient + (1.0 - u_ambient) * diff;\n \n // Fade based on depth (Z position)\n float fade = 1.0;\n if (u_fadeEnd > u_fadeStart) {\n fade = 1.0 - smoothstep(u_fadeStart, u_fadeEnd, v_depth);\n }\n \n fragColor = vec4(v_color * lighting, u_opacity * fade);\n}\n";
18
18
  export declare const VECTOR_FIELD_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position; // Base geometry (e.g., arrow)\nin vec3 a_instancePos; // Origin of the vector\nin vec3 a_direction; // Direction vector [dx, dy, dz]\nin vec3 a_color;\nin vec3 a_normal;\n\nuniform mat4 u_viewProjection;\nuniform float u_scaleMultiplier;\n\nout vec3 v_color;\nout vec3 v_normal;\n\nvoid main() {\n float mag = length(a_direction);\n vec3 dir = normalize(a_direction);\n \n // Construct rotation matrix to align with direction\n vec3 up = abs(dir.y) < 0.99 ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0);\n vec3 right = normalize(cross(up, dir));\n vec3 actualUp = cross(dir, right);\n mat3 rotation = mat3(right, actualUp, dir);\n \n v_normal = rotation * a_normal;\n \n // Scale based on magnitude\n vec3 scaledPos = a_position * mag * u_scaleMultiplier;\n \n // Rotate and translate\n vec3 worldPos = (rotation * scaledPos) + a_instancePos;\n \n gl_Position = u_viewProjection * vec4(worldPos, 1.0);\n v_color = a_color;\n}\n";
19
- export declare const VECTOR_FIELD_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin vec3 v_normal;\nuniform float u_opacity;\nuniform vec3 u_lightDir;\nout vec4 fragColor;\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n float diff = max(dot(normal, normalize(u_lightDir)), 0.3);\n fragColor = vec4(v_color * diff, u_opacity);\n}\n";
19
+ export declare const VECTOR_FIELD_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin vec3 v_normal;\nuniform float u_opacity;\nuniform vec3 u_lightDir;\nuniform float u_ambient;\nout vec4 fragColor;\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n vec3 lightDir = normalize(u_lightDir);\n float diff = max(dot(normal, lightDir), 0.0);\n float lighting = u_ambient + (1.0 - u_ambient) * diff;\n fragColor = vec4(v_color * lighting, u_opacity);\n}\n";
20
20
  export declare const POINT_CLOUD_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position;\nin vec3 a_color;\nin float a_size;\n\nuniform mat4 u_viewProjection;\nuniform float u_globalSize;\n\nout vec3 v_color;\n\nvoid main() {\n gl_Position = u_viewProjection * vec4(a_position, 1.0);\n gl_PointSize = a_size * u_globalSize;\n v_color = a_color;\n \n // Basic depth attenuation (points get smaller with distance)\n gl_PointSize /= gl_Position.w * 0.5;\n}\n";
21
21
  export declare const POINT_CLOUD_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nuniform float u_opacity;\nuniform bool u_circular;\n\nout vec4 fragColor;\n\nvoid main() {\n if (u_circular) {\n vec2 dist = gl_PointCoord - vec2(0.5);\n if (dot(dist, dist) > 0.25) discard;\n }\n \n fragColor = vec4(v_color, u_opacity);\n}\n";
22
22
  export declare const VOXEL_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position; // Base cube vertex\nin vec3 a_instancePos; // Voxel center\nin float a_value; // Voxel intensity [0, 1]\n\nuniform mat4 u_viewProjection;\nuniform float u_voxelSize;\nuniform float u_threshold;\n\nout float v_value;\nout vec3 v_normal;\n\nvoid main() {\n if (a_value < u_threshold) {\n // Hide voxel if below threshold\n gl_Position = vec4(2.0, 2.0, 2.0, 1.0);\n return;\n }\n \n vec3 worldPos = (a_position * u_voxelSize) + a_instancePos;\n gl_Position = u_viewProjection * vec4(worldPos, 1.0);\n v_value = a_value;\n v_normal = normalize(a_position);\n}\n";
23
- export declare const VOXEL_FRAG = "#version 300 es\nprecision highp float;\n\nin float v_value;\nin vec3 v_normal;\n\nuniform float u_opacity;\nuniform vec3 u_lightDir;\n\nout vec4 fragColor;\n\n// Simple heatmap coloring\nvec3 heatmap(float t) {\n return vec3(t, 1.0 - t, 0.5 + sin(t * 3.14159) * 0.5);\n}\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n float diff = max(dot(normal, normalize(u_lightDir)), 0.3);\n \n // Spectral colormap\n vec3 color = vec3(v_value, 0.2, 1.0 - v_value);\n if (v_value > 0.5) color = vec3(1.0, 1.0 - (v_value-0.5)*2.0, 0.0);\n \n fragColor = vec4(color * diff, u_opacity * v_value);\n}\n";
23
+ export declare const VOXEL_FRAG = "#version 300 es\nprecision highp float;\n\nin float v_value;\nin vec3 v_normal;\n\nuniform float u_opacity;\nuniform vec3 u_lightDir;\nuniform float u_ambient;\n\nout vec4 fragColor;\n\n// Simple heatmap coloring\nvec3 heatmap(float t) {\n return vec3(t, 1.0 - t, 0.5 + sin(t * 3.14159) * 0.5);\n}\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n vec3 lightDir = normalize(u_lightDir);\n float diff = max(dot(normal, lightDir), 0.0);\n float lighting = u_ambient + (1.0 - u_ambient) * diff;\n \n // Spectral colormap\n vec3 color = vec3(v_value, 0.2, 1.0 - v_value);\n if (v_value > 0.5) color = vec3(1.0, 1.0 - (v_value-0.5)*2.0, 0.0);\n \n fragColor = vec4(color * lighting, u_opacity * v_value);\n}\n";
24
24
  export declare const RIBBON_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position;\nin vec3 a_normal;\nin vec3 a_color;\n\nuniform mat4 u_viewProjection;\n\nout vec3 v_color;\nout vec3 v_normal;\n\nvoid main() {\n gl_Position = u_viewProjection * vec4(a_position, 1.0);\n v_color = a_color;\n v_normal = a_normal;\n}\n";
25
- export declare const RIBBON_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin vec3 v_normal;\n\nuniform float u_opacity;\nuniform vec3 u_lightDir;\n\nout vec4 fragColor;\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n float diff = max(dot(normal, normalize(u_lightDir)), 0.45);\n fragColor = vec4(v_color * diff, u_opacity);\n}\n";
25
+ export declare const RIBBON_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin vec3 v_normal;\n\nuniform float u_opacity;\nuniform vec3 u_lightDir;\nuniform float u_ambient;\n\nout vec4 fragColor;\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n vec3 lightDir = normalize(u_lightDir);\n float diff = max(dot(normal, lightDir), 0.0);\n float lighting = u_ambient + (1.0 - u_ambient) * diff;\n fragColor = vec4(v_color * lighting, u_opacity);\n}\n";
26
26
  export declare const SURFACE_BAR_VERT = "#version 300 es\nprecision highp float;\n\nin vec3 a_position; // Base cube vertex [-0.5, 0.5]\nin vec3 a_instancePos; // Column base\nin float a_height; // Column height\nin vec3 a_color;\n\nuniform mat4 u_viewProjection;\nuniform float u_barWidth;\nuniform float u_barDepth;\n\nout vec3 v_color;\nout vec3 v_normal;\n\nvoid main() {\n vec3 pos = a_position;\n pos.x *= u_barWidth;\n pos.z *= u_barDepth;\n pos.y = (pos.y + 0.5) * a_height; \n \n vec3 worldPos = pos + a_instancePos;\n gl_Position = u_viewProjection * vec4(worldPos, 1.0);\n \n v_color = a_color;\n // Normals for a cube are essentially the vertex positions normalized if centered at 0\n // But since we offset Y, we just use the original sign for flat shading or simple lighting\n v_normal = normalize(a_position);\n}\n";
27
- export declare const SURFACE_BAR_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin vec3 v_normal;\n\nuniform float u_opacity;\nuniform vec3 u_lightDir;\n\nout vec4 fragColor;\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n float diff = max(dot(normal, normalize(u_lightDir)), 0.4);\n fragColor = vec4(v_color * diff, u_opacity);\n}\n";
27
+ export declare const SURFACE_BAR_FRAG = "#version 300 es\nprecision highp float;\n\nin vec3 v_color;\nin vec3 v_normal;\n\nuniform float u_opacity;\nuniform vec3 u_lightDir;\nuniform float u_ambient;\n\nout vec4 fragColor;\n\nvoid main() {\n vec3 normal = normalize(v_normal);\n vec3 lightDir = normalize(u_lightDir);\n float diff = max(dot(normal, lightDir), 0.0);\n float lighting = u_ambient + (1.0 - u_ambient) * diff;\n fragColor = vec4(v_color * lighting, u_opacity);\n}\n";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scichart-engine",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "author": "jigonzalez930209",
5
5
  "license": "MIT",
6
6
  "repository": {