perspective-viewer 5.4.0

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
Documentation
/* ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
 * ┃ ██████ ██████ ██████       █      █      █      █      █ █▄  ▀███ █       ┃
 * ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█  ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄  ▀█ █ ▀▀▀▀▀ ┃
 * ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄   █ ▄▄▄▄▄ ┃
 * ┃ █      ██████ █  ▀█▄       █ ██████      █      ███▌▐███ ███████▄ █       ┃
 * ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
 * ┃ Copyright (c) 2017, the Perspective Authors.                              ┃
 * ┃ ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌ ┃
 * ┃ This file is part of the Perspective library, distributed under the terms ┃
 * ┃ of the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). ┃
 * ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
 */

/* Panel context menu (right-click a panel). The `<perspective-context-menu>`
 * host is a viewer light-DOM child in the top layer (see `PortalModal`),
 * themed by the `--psp-*` vars it inherits; its chrome lives here, exactly
 * like the Copy/Export menus' surface. */

@import "./dropdown-menu-items.css";

:host {
    overflow: visible;
    padding: 0;
    background-color: var(--psp--background-color, #ffffff);
    color: var(--psp--color, #161616);
    border: 1px solid var(--psp-inactive--color, #ababab);
    border-radius: 0 0 2px 2px;
    outline: none;
    user-select: none;
    font-size: 12px;
    box-shadow: var(--psp-dropdown--box-shadow);
}

.context-menu {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    padding: 0px 0;
}

.context-menu-item {
    position: relative;
    padding: 4px 12px;
    cursor: pointer;
    white-space: nowrap;

    /* The dropdown-menu surface's inverted hover, from the same theme keys
     * (`--psp--color`/`--psp--background-color` land on the host via the
     * modal selector groups) — the Copy/Export pickers this menu spawns use
     * exactly this idiom. */
    &:hover {
        background-color: var(--psp--color);
        color: var(--psp--background-color);
    }

    &.disabled {
        opacity: 0.4;
        cursor: default;

        &:hover {
            background-color: transparent;
            color: inherit;
        }
    }

    &.has-submenu {
        display: flex;
        align-items: center;

        &::after {
            content: "";
            margin-left: auto;
            padding-left: 12px;
        }

        &:hover > .context-menu-submenu {
            display: flex;
        }
    }
}

.context-menu-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -1px;
    max-height: 50vh;
    overflow-y: auto;
    background-color: var(--psp--background-color, white);

    /* The flyout is a CHILD of its (necessarily hovered, so inverted) parent
     * item — un-hovered rows must not inherit the parent's inverted
     * foreground. */
    color: var(--psp--color);
    border: 1px solid var(--psp-inactive--color);
    box-shadow: var(--psp-dropdown--box-shadow);
}

.context-menu-submenu > .new-panel-menu {
    display: flex;
    flex-direction: column;
    padding: 8px;
    min-width: 120px;
}

.context-menu-header {
    padding: 4px 12px 2px;
    cursor: default;
    white-space: nowrap;
    font-size: 9px;
    text-transform: uppercase;
    color: var(--psp-inactive--color, #ababab);
}