import Settings from "./../../Settings"; import DataNode from "./../../DataNode"; import ColorPalette from "./../../color/ColorPalette"; import StringUtils from "./../../utilities/StringUtils"; export default class SunburstSettings extends Settings { /** * Radius size of the sunburst visualization (in pixels). */ radius: number = 300; /** * Amount of pixels that are reserved for the breadcrumbs (to the right of the sunburst visualization itself). */ breadcrumbWidth: number = 200; /** * Classname that's internally used for the object. */ className: string = "sunburst"; /** * Should the colors that are used to mark nodes be based upon the label-names? (I.e. if this is enabled, all nodes * with the same label, will receive the same color). */ useFixedColors: boolean = false; /** * Default color palette that should be used for the node colors. Use one of the predefined palettes from the * ColorPalette-class if you don't feel inspired. */ colorPalette: string[] = ColorPalette.DEFAULT_COLORS; /** * Color palette that should be used if the useFixedColors option is enabled. */ fixedColorPalette: string[] = ColorPalette.FIXED_COLORS; /** * Should breadcrumbs be shown to the right of the sunburst visualization? */ enableBreadcrumbs: boolean = true; /** * With how many levels can the user interact in the sunburst visualization? */ levels: number = 4; /** * How long should the sunburst visualization animation take (in milliseconds)? */ animationDuration: number = 1000; /** * Callback that's called whenever the user clicks on a node in the visualization. */ rerootCallback: (node: DataNode) => void = () => {}; /** * Returns the hash that's used to determine which color should be assigned to this datanode. The hash should be * a number. Hash should be the same for all nodes to which the same color should be assigned. * * @param node The DataNode for which the current hash should be returned. */ fixedColorHash: (node: DataNode) => number = (node: DataNode) => StringUtils.stringHash(node.name); /** * Returns the html to use as tooltip for current mouse position. This tooltip provides information to the user * about the node that's currently hovered by the mouse cursor. * * @param value Current node that's being hovered by the mouse cursor. * @return A valid HTML-string that represents a tooltip. */ getTooltip: ( value: DataNode, ) => string = (value: DataNode) => { return `