CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-pyecharts

Python ❤️ ECharts = pyecharts - comprehensive data visualization toolkit built on Apache ECharts

Pending
Overview
Eval results
Files

3d-charts.mddocs/

3D Charts

Three-dimensional visualizations with advanced rendering capabilities including 3D coordinate systems, lighting effects, materials, and interactive camera controls. These charts leverage WebGL for high-performance 3D graphics in web browsers.

Capabilities

3D Bar Charts

Three-dimensional bar charts for categorical data with depth and perspective.

class Bar3D:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D bar chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, data, **kwargs):
        """
        Add 3D bar data.
        
        Args:
            series_name (str): Name of the data series
            data (list): List of [x, y, z] coordinate triplets
            xaxis3d_opts (Axis3DOpts, optional): X-axis configuration
            yaxis3d_opts (Axis3DOpts, optional): Y-axis configuration  
            zaxis3d_opts (Axis3DOpts, optional): Z-axis configuration
            grid3d_opts (Grid3DOpts, optional): 3D grid configuration
            
        Returns:
            Bar3D: Self for method chaining
        """

Usage Example:

from pyecharts.charts import Bar3D
from pyecharts import options as opts
import random

data = []
for i in range(10):
    for j in range(10):
        data.append([i, j, random.randint(0, 100)])

bar3d = (
    Bar3D()
    .add("Data", data)
    .set_global_opts(title_opts=opts.TitleOpts(title="3D Bar Chart"))
)

3D Scatter Charts

Three-dimensional scatter plots for exploring relationships in three variables.

class Scatter3D:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D scatter chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, data, **kwargs):
        """
        Add 3D scatter data.
        
        Args:
            series_name (str): Name of the data series
            data (list): List of [x, y, z] coordinate triplets or [x, y, z, value] quadruplets
            symbol (str, optional): Point symbol type
            symbol_size (int|list, optional): Point size
            itemstyle_opts (ItemStyleOpts, optional): Point styling
            xaxis3d_opts (Axis3DOpts, optional): X-axis configuration
            yaxis3d_opts (Axis3DOpts, optional): Y-axis configuration
            zaxis3d_opts (Axis3DOpts, optional): Z-axis configuration
            grid3d_opts (Grid3DOpts, optional): 3D grid configuration
            
        Returns:
            Scatter3D: Self for method chaining
        """

3D Line Charts

Three-dimensional line charts connecting points in 3D space.

class Line3D:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D line chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, data, **kwargs):
        """
        Add 3D line data.
        
        Args:
            series_name (str): Name of the data series
            data (list): List of [x, y, z] coordinate triplets
            linestyle_opts (LineStyleOpts, optional): Line styling
            xaxis3d_opts (Axis3DOpts, optional): X-axis configuration
            yaxis3d_opts (Axis3DOpts, optional): Y-axis configuration
            zaxis3d_opts (Axis3DOpts, optional): Z-axis configuration
            grid3d_opts (Grid3DOpts, optional): 3D grid configuration
            
        Returns:
            Line3D: Self for method chaining
        """

3D Multi-Line Charts

Multiple line series in 3D space with animation effects.

class Lines3D:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D multi-line chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, data, **kwargs):
        """
        Add 3D lines data.
        
        Args:
            series_name (str): Name of the data series
            data (list): List of [start_point, end_point] pairs where each point is [x, y, z]
            effect_opts (Lines3DEffectOpts, optional): Animation effects
            linestyle_opts (LineStyleOpts, optional): Line styling
            xaxis3d_opts (Axis3DOpts, optional): X-axis configuration
            yaxis3d_opts (Axis3DOpts, optional): Y-axis configuration
            zaxis3d_opts (Axis3DOpts, optional): Z-axis configuration
            grid3d_opts (Grid3DOpts, optional): 3D grid configuration
            
        Returns:
            Lines3D: Self for method chaining
        """

3D Surface Charts

Surface plots for visualizing functions of two variables or 3D terrain data.

class Surface3D:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D surface chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, data, **kwargs):
        """
        Add 3D surface data.
        
        Args:
            series_name (str): Name of the data series
            data (list): 2D array of z-values or list of [x, y, z] triplets
            is_parametric (bool, optional): Whether data is parametric
            wire_frame (dict, optional): Wireframe styling
            itemstyle_opts (ItemStyleOpts, optional): Surface styling
            xaxis3d_opts (Axis3DOpts, optional): X-axis configuration
            yaxis3d_opts (Axis3DOpts, optional): Y-axis configuration
            zaxis3d_opts (Axis3DOpts, optional): Z-axis configuration
            grid3d_opts (Grid3DOpts, optional): 3D grid configuration
            
        Returns:
            Surface3D: Self for method chaining
        """

3D Geographic Maps

Three-dimensional geographic visualizations with elevation and depth.

class Map3D:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D map chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, data_pair, **kwargs):
        """
        Add 3D map data.
        
        Args:
            series_name (str): Name of the data series
            data_pair (list): List of [region_name, value] pairs
            maptype (str): Map type identifier
            itemstyle_opts (ItemStyleOpts, optional): Region styling
            label_opts (Map3DLabelOpts, optional): Label configuration
            emphasis_opts (Emphasis3DOpts, optional): Hover effects
            light_opts (Map3DLightOpts, optional): Lighting configuration
            viewcontrol_opts (Map3DViewControlOpts, optional): Camera controls
            posteffect_opts (Map3DPostEffectOpts, optional): Post-processing effects
            
        Returns:
            Map3D: Self for method chaining
        """

3D Globe Visualizations

Interactive globe representations for global geographic data.

class MapGlobe:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D globe chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, data_pair, **kwargs):
        """
        Add globe data.
        
        Args:
            series_name (str): Name of the data series
            data_pair (list): List of [location_name, value] pairs
            maptype (str): Map type ("world" for global)
            is_roam (bool, optional): Enable globe rotation
            
        Returns:
            MapGlobe: Self for method chaining
        """

3D Network Graphs

Three-dimensional network visualizations with advanced force-directed layouts.

class GraphGL:
    def __init__(self, init_opts=None, render_opts=None):
        """
        Initialize a 3D graph chart.
        
        Args:
            init_opts (InitOpts, optional): Chart initialization options
            render_opts (RenderOpts, optional): Rendering options
        """

    def add(self, series_name, nodes, links, **kwargs):
        """
        Add 3D graph data.
        
        Args:
            series_name (str): Name of the data series
            nodes (list): List of GraphGLNode objects or node dictionaries
            links (list): List of GraphGLLink objects or link dictionaries
            layout (str, optional): Layout algorithm ("force", "circular", "none")
            force_atlas2_opts (GraphGLForceAtlas2Opts, optional): Force layout options
            itemstyle_opts (ItemStyleOpts, optional): Node styling
            linestyle_opts (LineStyleOpts, optional): Edge styling
            
        Returns:
            GraphGL: Self for method chaining
        """

3D Configuration Options

3D Coordinate System

class Axis3DOpts:
    def __init__(self, **kwargs):
        """
        3D axis configuration.
        
        Args:
            type_ (str): Axis type ("value", "category", "time", "log")
            name (str): Axis name
            min_ (numeric): Minimum value
            max_ (numeric): Maximum value
            data (list): Category data for category axes
            axislabel_opts (LabelOpts): Axis label styling
            axisline_opts (AxisLineOpts): Axis line styling
            axistick_opts (AxisTickOpts): Axis tick styling
            splitline_opts (SplitLineOpts): Grid line styling
        """

class Grid3DOpts:
    def __init__(self, **kwargs):
        """
        3D grid configuration.
        
        Args:
            width (int): Grid width
            height (int): Grid height  
            depth (int): Grid depth
            is_rotate (bool): Enable auto-rotation
            rotate_speed (int): Rotation speed
            rotate_sensitivity (int): Mouse rotation sensitivity
            zoom_sensitivity (int): Zoom sensitivity
            pan_sensitivity (int): Pan sensitivity
            distance (int): Camera distance
            alpha (int): Horizontal rotation angle
            beta (int): Vertical rotation angle
            center (list): Grid center position [x, y, z]
            box_width (int): 3D box width
            box_height (int): 3D box height
            box_depth (int): 3D box depth
        """

3D Lighting and Materials

class Map3DLightOpts:
    def __init__(self, **kwargs):
        """
        3D lighting configuration.
        
        Args:
            main_color (str): Main light color
            main_intensity (float): Main light intensity
            main_shadow (bool): Enable main light shadows
            main_shadow_quality (str): Shadow quality ("low", "medium", "high", "ultra")
            main_beta (int): Main light elevation angle
            ambient_color (str): Ambient light color
            ambient_intensity (float): Ambient light intensity
        """

class Map3DColorMaterialOpts:
    def __init__(self, **kwargs):
        """3D color material options."""

class Map3DLambertMaterialOpts:
    def __init__(self, **kwargs):
        """3D Lambert material options for matte surfaces."""

class Map3DRealisticMaterialOpts:
    def __init__(self, **kwargs):
        """3D realistic material options with reflectance and roughness."""

3D View Controls

class Map3DViewControlOpts:
    def __init__(self, **kwargs):
        """
        3D view control configuration.
        
        Args:
            projection (str): Projection type ("perspective", "orthographic")
            auto_rotate (bool): Enable auto-rotation
            auto_rotate_direction (str): Rotation direction ("cw", "ccw")
            auto_rotate_speed (int): Rotation speed
            damping (float): Damping factor for smooth interaction
            roam (bool): Enable mouse interaction
            rotate_sensitivity (int): Rotation sensitivity
            zoom_sensitivity (int): Zoom sensitivity
            pan_sensitivity (int): Pan sensitivity
            pan_mouse_button (str): Mouse button for panning
            rotate_mouse_button (str): Mouse button for rotation
            distance (int): Camera distance
            min_distance (int): Minimum camera distance
            max_distance (int): Maximum camera distance
            orthographic_size (int): Orthographic view size
            max_orthographic_size (int): Maximum orthographic size
            min_orthographic_size (int): Minimum orthographic size
            alpha (int): Horizontal rotation angle
            beta (int): Vertical rotation angle
            center (list): View center [x, y, z]
            min_alpha (int): Minimum alpha angle
            max_alpha (int): Maximum alpha angle
            min_beta (int): Minimum beta angle
            max_beta (int): Maximum beta angle
        """

3D Post-Processing Effects

class Map3DPostEffectOpts:
    def __init__(self, **kwargs):
        """
        3D post-processing effects.
        
        Args:
            is_enable (bool): Enable post-processing
            bloom_enable (bool): Enable bloom effect
            bloom_intensity (float): Bloom intensity
            depth_of_field_enable (bool): Enable depth of field
            depth_of_field_focal_distance (float): Focal distance
            depth_of_field_focal_range (float): Focal range
            depth_of_field_f_stop (float): F-stop value
            depth_of_field_blur_radius (int): Blur radius
            screen_space_ambient_occlusion_enable (bool): Enable SSAO
            screen_space_ambient_occlusion_quality (str): SSAO quality
            screen_space_ambient_occlusion_radius (float): SSAO radius
            screen_space_ambient_occlusion_intensity (float): SSAO intensity
            screen_space_reflection_enable (bool): Enable screen space reflections
            screen_space_reflection_quality (str): SSR quality
            screen_space_reflection_max_roughness (float): Maximum roughness for reflections
            temporal_super_sampling_enable (bool): Enable temporal super sampling
        """

3D Data Types

class GraphGLNode:
    def __init__(self, **kwargs):
        """
        3D graph node.
        
        Args:
            id (str): Node identifier
            name (str): Node display name
            value (list): 3D position [x, y, z]
            category (str): Node category
            symbol (str): Node symbol
            symbol_size (int): Node size
            itemstyle_opts (ItemStyleOpts): Node styling
        """

class GraphGLLink:
    def __init__(self, **kwargs):
        """
        3D graph edge/link.
        
        Args:
            source (str): Source node ID
            target (str): Target node ID
            value (numeric): Link weight/value
            linestyle_opts (LineStyleOpts): Link styling
        """

class GraphGLForceAtlas2Opts:
    def __init__(self, **kwargs):
        """
        3D force-directed layout configuration.
        
        Args:
            gpu (bool): Use GPU acceleration
            steps (int): Number of simulation steps
            stop_threshold (float): Stop threshold
            bar_nes_theta (float): Barnes-Hut theta parameter
            repulsion_by_degree (bool): Repulsion based on node degree
            lin_log_mode (bool): Use lin-log mode
            gravity (float): Gravity strength
            scaling_ratio (float): Scaling ratio
            strong_gravity_mode (bool): Strong gravity mode
            gravity_center (list): Gravity center [x, y, z]
        """

class Lines3DEffectOpts:
    def __init__(self, **kwargs):
        """
        3D line animation effects.
        
        Args:
            is_show (bool): Show effects
            period (int): Animation period
            delay (int): Animation delay
            constant_speed (int): Constant animation speed
            symbol (str): Effect symbol
            symbol_size (int): Effect symbol size
            color (str): Effect color
            opacity (float): Effect opacity
            trail_length (float): Trail length ratio
        """

Install with Tessl CLI

npx tessl i tessl/pypi-pyecharts

docs

3d-charts.md

basic-charts.md

composite-charts.md

geographic-charts.md

index.md

options.md

rendering.md

utilities.md

tile.json