preference = {
    # light.
    "light.eye_dome_lighting": False,
    "light.pbr": False,
    "light.metallic": 0.1,
    "light.roughness": 0.2,
    "light.intensity": 0.5,
    # label.
    "label.font": "arial",  # "courier/times/arial"
    "label.size": 18,
    "label.bold": False,
    "label.italic": False,
    "label.color": "licorice",
    # vector.
    "vector.tip.length": 0.35,
    "vector.tip.radius": 0.04,
    "vector.shaft.radius": 0.02,
    # cell.
    "cell.width": 1.0,
    "cell.color": "black",
    "cell.opacity": 1.0,
    # spotlight.
    "spotlight.color": "orange",
    "spotlight.opacity": 0.3,
    "spotlight.size": 0.15,
    # axis.
    "axis.type": "xyz",
    "axis.size": 18,
    "axis.bold": True,
    "axis.italic": False,
    "axis.position": 1.0,
}

rcParams = {
    # default of initial setting.
    "init.title": "QtDraw",
    "init.model": "untitled",
    "init.origin": "[0.0,0.0,0.0]",
    "init.view": "[4,5,2]",
    "init.size": "[1174,768]",  # (width, height) including side panel
    "init.view_range": ["[0.0,0.0,0.0]", "[1.01,1.01,1.01]"],
    "init.parallel_projection": True,
    "init.axis": "on",  # "on/axis/off"
    "init.cell": "single",  # "single/all/off"
    "init.grid": False,
    #
    # plotter setting.
    "plotter.ui": "qtdraw.ui",
    "plotter.style": "fusion",  # "fusion/windows/macintosh"
    "plotter.font.family": "Helvetica Neue",  # "Monaco/Osaka/Times New Roman/Arial/Helvetica Neue"
    "plotter.font.size": 13,  # pixel
    "plotter.theme": "document",  # "document/paraview/default/dark"
    "plotter.ext": ".qtdw",
    "plotter.cif": ".cif",
    "plotter.vesta": ".vesta",
    "plotter.color_scheme": "VESTA",  # "VESTA/Jmol"
    "plotter.site_scale": 1.2,
    "plotter.bond_scale": 1.2,
    #
    # default for plotting.
    "plot.orbital.theta": 180,
    "plot.orbital.phi": 180,
    #
    # detailed setting.
    "detail.axis.shaft.radius": 0.05,
    "detail.axis.tip.radius": 0.1,
    "detail.axis.tip.length": 0.4,
    "detail.axis.tip.resolution": 60,
    "detail.axis.center.radius": 0.14,
    "detail.axis.center.theta": 60,
    "detail.axis.center.phi": 60,
    "detail.axis.viewport": (0.0, 0.0, 0.25, 0.25),
    "detail.axis.scale": 2.2,
    "detail.axis.label.position": [[0.26, -0.52, 0.0], [-0.44, 0.26, 0.0], [0.0, 0.0, 0.45]],
    "detail.axis.label": {"xyz": ("x", "y", "z"), "abc": ("a", "b", "c"), "abc*": ("a*", "b*", "c*")},
    "detail.axis.label.color": ("black", "black", "black"),
    "detail.axis.color": ["crimson", "forestgreen", "royalblue"],
    "detail.axis.color.center": "snow",
    "detail.smooth.samples": 10,
    "detail.smooth.line": True,
    "detail.smooth.point": True,
    "detail.smooth.polygon": True,
    "detail.smooth.shading": True,
    "detail.smooth.anti_aliasing": False,  # if use True, it does not work correctly for some environment
    "detail.latex.color": "black",
    "detail.latex.dpi": 300,
    "detail.latex.format": "png",  # "png/svg/jpg"
    "detail.image.width": 100,
    "detail.table.bg_color": "lightgrey",
    "detail.screenshot.ext": ".png",
    "detail.screenshot.ifile": "*.png *.bmp *.tif *.tiff",  # jpeg, jpg do not work.
    "detail.screenshot.gfile": "*.svg *.eps *.ps *.pdf",
    #
    # dataset infomation setting.
    "detail.dataset.property": {  # last column in the role is default value.
        "site": (
            ["name", "ON", "label", "cell", "position", "size", "color", "opacity", "space", "D", "AD", "AL"],
            [
                ("check", "D", "AD", "S"),
                ("check", "ON", "", False),
                ("text", "S"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("text", "real_positive", 2, 1.0),
                ("color", "darkseagreen"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "bond": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "vector",
                "width",
                "color",
                "color2",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "b"),
                ("check", "ON", "", False),
                ("text", "b"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("text", "r_vector", [0.0, 0.0, 1.0]),
                ("text", "real_positive", 2, 1.0),
                ("color", "silver"),
                ("color", "silver"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "vector": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "vector",
                "length",
                "width",
                "offset",
                "color",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "vec"),
                ("check", "ON", "", False),
                ("text", "vec"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("text", "r_vector", [0.0, 0.0, 1.0]),
                ("text", "real_positive", 2, 1.0),
                ("text", "real_positive", 2, 1.0),
                ("text", "real", 2, -0.43),
                ("color", "orange"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "orbital": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "shape",
                "surface",
                "size",
                "scale",
                "theta0",
                "theta1",
                "phi0",
                "phi1",
                "color",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "orb"),
                ("check", "ON", "", False),
                ("text", "orb"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("math", "s_scalar", ["x", "y", "z", "r"], "1"),
                ("math", "s_scalar", ["x", "y", "z", "r"], "0"),
                ("text", "real_positive", 2, 0.1),
                ("check", "scale", "", True),
                ("text", "int_positive", 0),
                ("text", "int_positive", 180),
                ("text", "int_positive", 0),
                ("text", "int_positive", 360),
                ("color_both", "Wistia"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "stream": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "shape",
                "vector",
                "size",
                "v_size",
                "width",
                "scale",
                "theta",
                "phi",
                "theta0",
                "theta1",
                "phi0",
                "phi1",
                "color",
                "component",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "stm"),
                ("check", "ON", "", False),
                ("text", "stm"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("math", "s_scalar", ["x", "y", "z", "r"], "1"),
                ("math", "s_column_vector", ["x", "y", "z", "r"], "[x, y, z]"),
                ("text", "real_positive", 2, 1.0),
                ("text", "real_positive", 2, 0.4),
                ("text", "real_positive", 2, 1.0),
                ("check", "scale", "", False),
                ("text", "int_positive", 20),
                ("text", "int_positive", 15),
                ("text", "int_positive", 0),
                ("text", "int_positive", 180),
                ("text", "int_positive", 0),
                ("text", "int_positive", 360),
                ("color_both", "coolwarm"),
                ("combo", ["x", "y", "z", "abs"], 3),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "plane": (
            ["name", "ON", "label", "cell", "position", "normal", "x", "y", "color", "opacity", "space", "D", "AD", "AL"],
            [
                ("check", "D", "AD", "pl"),
                ("check", "ON", "", False),
                ("text", "pl"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("text", "r_vector", 2, [0.0, 0.0, 1.0]),
                ("text", "real_positive", 2, 1.0),
                ("text", "real_positive", 2, 1.0),
                ("color", "sky"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "box": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "a1",
                "a2",
                "a3",
                "edge",
                "wireframe",
                "width",
                "color",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "box"),
                ("check", "ON", "", False),
                ("text", "box"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("text", "r_vector", [1.0, 0.0, 0.0]),
                ("text", "r_vector", [0.0, 1.0, 0.0]),
                ("text", "r_vector", [0.0, 0.0, 1.0]),
                ("check", "edge", "", False),
                ("check", "wireframe", "", False),
                ("text", "real_positive", 2, 1.0),
                ("color", "honeydew"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "polygon": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "point",
                "connection",
                "edge",
                "wireframe",
                "width",
                "color",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "pl"),
                ("check", "ON", "", False),
                ("text", "pl"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                (
                    "text",
                    "r_vector_list",
                    [[0.0, 0.0, 0.0], [0.2, 0.0, 0.0], [0.0, 0.2, 0.0], [0.0, 0.0, 0.2]],
                ),
                ("text", "i_pos_matrix", [[0, 1, 2], [0, 1, 3], [1, 2, 3], [2, 0, 3]]),
                ("check", "edge", "", True),
                ("check", "wireframe", "", False),
                ("text", "real_positive", 2, 2.0),
                ("color", "aluminum"),
                ("text", "real_unit", 2, 0.5),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "text3d": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "text",
                "size",
                "depth",
                "normal",
                "offset",
                "color",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "txt3"),
                ("check", "ON", "", False),
                ("text", "txt3"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("text", "string", "text"),
                ("text", "real_positive", 2, 1.0),
                ("text", "real_positive", 2, 1.0),
                ("text", "r_vector", 2, [0.0, 0.0, 1.0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("color", "iron"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "spline": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "point",
                "width",
                "n_interp",
                "closed",
                "natural",
                "color",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "spl"),
                ("check", "ON", "", False),
                ("text", "spl"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("text", "r_vector_list", [[0.0, 0.0, 0.0], [1.0, 0.0, 1.0], [0.0, 1.0, 2.0]]),
                ("text", "real_positive", 2, 1.0),
                ("text", "int_positive", 100),
                ("check", "closed", "", False),
                ("check", "natural", "", True),
                ("color", "banana"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "spline_t": (
            [
                "name",
                "ON",
                "label",
                "cell",
                "position",
                "expression",
                "t_range",
                "width",
                "n_interp",
                "closed",
                "natural",
                "color",
                "opacity",
                "space",
                "D",
                "AD",
                "AL",
            ],
            [
                ("check", "D", "AD", "spt"),
                ("check", "ON", "", False),
                ("text", "spt"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector", [0.0, 0.0, 0.0]),
                ("math", "s_column_vector", ["t"], "[cos(2 pi t), sin(2 pi t), t/2]"),
                ("text", "r_vector", [0.0, 2.0, 0.01]),
                ("text", "real_positive", 2, 1.0),
                ("text", "int_positive", 100),
                ("check", "closed", "", False),
                ("check", "natural", "", True),
                ("color", "banana"),
                ("text", "real_unit", 2, 1.0),
                ("text", "int_positive", 3),
                ("hide", True),
                ("hide", ""),
                ("hide", ""),
            ],
        ),
        "caption": (
            ["name", "cell", "position", "caption", "space", "size", "bold", "color", "D", "AD"],
            [
                ("check", "D", "AD", "cap"),
                ("text", "i_vector", [0, 0, 0]),
                ("text", "r_vector_list", [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]]),
                ("text", "s_column", ["0", "1"]),
                ("text", "int_positive", 0),
                ("text", "int_positive", 18),
                ("check", "bold", "", False),
                ("color", "licorice"),
                ("hide", True),
                ("hide", ""),
            ],
        ),
        "text": (
            ["name", "position", "relative", "caption", "size", "color", "font", "D", "AD"],
            [
                ("check", "D", "AD", "txt"),
                ("text", "r_list", [0.02, 0.95]),
                ("check", "relative", "", True),
                ("text", "latex", "text"),
                ("text", "int_positive", 8),
                ("color", "licorice"),
                ("combo", ["arial", "times", "courier"], 0),
                ("hide", True),
                ("hide", ""),
            ],
        ),
    },
}
