Skip to content

Commit

Permalink
Refactoring cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
texodus committed Oct 10, 2023
1 parent 39d3338 commit 075967e
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 116 deletions.
2 changes: 1 addition & 1 deletion examples/blocks/src/file/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<form class="my-form">
<p>Upload a CSV/Arrow file by dragging from your desktop and dropping onto the dashed region.</p>
<p>(Data is processed in browser, and never sent to any server).</p>
<input type="file" id="fileElem" multiple accept=".feather .arrow .csv" />
<input type="file" id="fileElem" multiple accept=".feather,.arrow,.csv" />
<label class="button" for="fileElem">Select a file</label>
</form>
</div>
Expand Down
2 changes: 2 additions & 0 deletions packages/perspective-viewer-datagrid/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ async function compile_css() {
add(builder1, "./pro.less");
add(builder1, "./mitered-headers.less");
add(builder1, "./row-hover.less");
add(builder1, "./sub-cell-scroll.less");
add(builder1, "./scrollbar.less");
add(builder1, "./regular_table.less");
fs.writeFileSync(
"dist/css/perspective-viewer-datagrid.css",
Expand Down
87 changes: 1 addition & 86 deletions packages/perspective-viewer-datagrid/src/less/pro.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,74 +15,8 @@
regular-table {
padding: 0;
margin: 12px 0 0 12px;

// firefox scrollbar styling
scrollbar-color: transparent transparent;
scrollbar-width: thin;
outline: none;
}

regular-table:hover {
scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table {
tbody td,
thead th:not(.rt-group-corner) {
transform: translate(var(--regular-table--transform-x, 0px));
}

tbody {
transform: translate(0, var(--regular-table--transform-y, 0px));
}

tbody tr:first-child {
td,
th {
clip-path: polygon(
0 var(--regular-table--clip-y, 0),
0 200%,
200% 200%,
200% var(--regular-table--clip-y, 0)
);
}
}

thead th.rt-group-corner {
background: var(--plugin--background, white);
z-index: 1;
}

tbody tr td:first-of-type {
clip-path: polygon(
var(--regular-table--clip-x, 0) 0,
var(--regular-table--clip-x, 0) 200%,
200% 200%,
200% 0
);
}

tbody tr:first-child td:first-of-type {
clip-path: polygon(
var(--regular-table--clip-x, 0) var(--regular-table--clip-y, 0),
var(--regular-table--clip-x, 0) 200%,
200% 200%,
200% var(--regular-table--clip-y, 0)
);
}

thead tr:last-child:after {
transform: translate(var(--regular-table--transform-x, 0px));
}

tbody tr:not(:first-child):after {
transform: translate(var(--regular-table--transform-x, 0px));
}
}

regular-table {
font-family: inherit;
--rt-hover--border-color: #c5c9d080;
--rt-hover--border-color: var(--inactive--color, #c5c9d080);

div[tabindex] {
outline: none;
Expand Down Expand Up @@ -263,23 +197,4 @@ regular-table {
a:visited {
color: var(--active--color);
}

// webkit (chrome, safari, etc) scrollbar styling

&::-webkit-scrollbar,
&::-webkit-scrollbar-corner {
background-color: transparent;
height: 12px;
width: 12px;
}

&::-webkit-scrollbar-thumb {
background-clip: content-box;
background: var(--icon--color);
border: 5.5px solid var(--plugin--background);
max-height: 50%;
max-width: 50%;
min-width: 10%;
min-height: 10%;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@import "./pro.less";
@import "./mitered-headers.less";
@import "./row-hover.less";
@import "./sub-cell-scroll.less";
@import "./scrollbar.less";

// Row Selection

Expand Down
37 changes: 37 additions & 0 deletions packages/perspective-viewer-datagrid/src/less/scrollbar.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
// ┃ 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). ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

// Scrollbar styling
regular-table {
// firefox scrollbar styling
scrollbar-color: transparent transparent;
scrollbar-width: thin;
outline: none;

// webkit (chrome, safari, etc) scrollbar styling
&::-webkit-scrollbar,
&::-webkit-scrollbar-corner {
background-color: transparent;
height: 12px;
width: 12px;
}

&::-webkit-scrollbar-thumb {
background-clip: content-box;
background: var(--icon--color);
border: 5.5px solid var(--plugin--background);
max-height: 50%;
max-width: 50%;
min-width: 10%;
min-height: 10%;
}
}
80 changes: 80 additions & 0 deletions packages/perspective-viewer-datagrid/src/less/sub-cell-scroll.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
// ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
// ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
// ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄▄ ┃
// ┃ █ ██████ █ ▀█▄ █ ██████ █ ███▌▐███ ███████▄ █ ┃
// ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
// ┃ 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). ┃
// ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

// Handles sub-cell scrolling via CSS transform offset by variables set during
// rendering.
perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table {
tbody td,
thead th:not(.rt-group-corner) {
transform: translate(var(--regular-table--transform-x, 0px));
}

tbody {
transform: translate(0, var(--regular-table--transform-y, 0px));
}

tbody tr:first-child {
td,
th {
clip-path: polygon(
0 var(--regular-table--clip-y, 0),
0 200%,
200% 200%,
200% var(--regular-table--clip-y, 0)
);
}
}

tbody tr td:first-of-type {
clip-path: polygon(
var(--regular-table--clip-x, 0) 0,
var(--regular-table--clip-x, 0) 200%,
200% 200%,
200% 0
);
}

tbody tr:first-child td:first-of-type {
clip-path: polygon(
var(--regular-table--clip-x, 0) var(--regular-table--clip-y, 0),
var(--regular-table--clip-x, 0) 200%,
200% 200%,
200% var(--regular-table--clip-y, 0)
);
}

thead tr:last-child:after {
transform: translate(var(--regular-table--transform-x, 0px));
}

tbody tr:not(:first-child):after {
transform: translate(var(--regular-table--transform-x, 0px));
}

tbody tr:hover:first-child:after {
clip-path: polygon(
0 var(--regular-table--clip-y, 0),
0 200%,
200% 200%,
200% var(--regular-table--clip-y, 0)
);
}

thead tr th.rt-group-corner + th:not(.rt-group-corner) {
clip-path: polygon(
var(--regular-table--clip-x, 0) 0,
var(--regular-table--clip-x, 0) 200%,
200% 200%,
200% 0
);
}
}
4 changes: 2 additions & 2 deletions rust/perspective-viewer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions rust/perspective-viewer/src/themes/monokai.less
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ perspective-string-column-style[theme="Monokai"] {
regular-table {
--rt-pos-cell--color: #78dce8 !important;
--rt-neg-cell--color: #ff6188 !important;
}

regular-table table tbody tr td,
regular-table table tbody tr th {
border-top-color: #444444;
--rt--border-color: #444444;
}

regular-table table tbody th:empty {
Expand Down
6 changes: 1 addition & 5 deletions rust/perspective-viewer/src/themes/pro-dark.less
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ perspective-string-column-style[theme="Pro Dark"] {
regular-table {
--rt-pos-cell--color: #7dc3f0;
--rt-neg-cell--color: #ff9485;
--rt-hover--border-color: #61656e;

table {
color: white;
Expand All @@ -122,11 +123,6 @@ perspective-string-column-style[theme="Pro Dark"] {
table tr:hover {
color: white;
}

table tbody tr {

--rt-hover--border-color: #61656e;
}
}

tbody th:empty {
Expand Down
7 changes: 2 additions & 5 deletions rust/perspective-viewer/src/themes/solarized.less
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ perspective-string-column-style[theme="Solarized"] {
regular-table {
--rt-pos-cell--color: #268bd2 !important;
--rt-neg-cell--color: #cb4b16 !important;
--rt-hover--border-color: #CCC;
--rt--border-color: #93a1a1;
}

regular-table {
Expand All @@ -74,11 +76,6 @@ perspective-string-column-style[theme="Solarized"] {
}
}

regular-table table tbody tr td,
regular-table table tbody tr th {
border-top-color: #93a1a1;
}

regular-table table tbody th:empty {
background: linear-gradient(to right,
transparent 9px,
Expand Down
10 changes: 1 addition & 9 deletions rust/perspective-viewer/src/themes/vaporwave.less
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,8 @@ perspective-string-column-style[theme="Vaporwave"] {
--pp-color-1: rgb(9, 33, 50);
--pp-color-2: rgb(66, 182, 230);
--rt-pos-cell--color: rgb(66, 182, 230) !important;
}

regular-table td,
th {
--rt-hover--border-color: var(--pp-color-1) !important;
}

regular-table table tbody tr td,
regular-table table tbody tr th {
border-top-color: rgb(19, 33, 50) !important;
--rt--border-color: rgb(19, 33, 50) !important;
}

regular-table table tbody th:empty {
Expand Down
13 changes: 10 additions & 3 deletions tools/perspective-scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,21 @@ async function download_release_assets(releases) {
async function publish_release_assets(releases) {
if (process.env.COMMIT) {
for (const release of releases) {
if (release.name.endsWith("whl")) {
if (
(release.name.endsWith("whl") ||
release.name.endsWith("tar.gz")) &&
release.name.indexOf("wasm") === -1
) {
sh`twine upload ${release.name}`.runSync();
} else {
} else if (release.name.endsWith(".tgz")) {
sh`npm publish ${release.name}`.runSync();
}
}

sh`cargo publish`.cwd("rust/perspective-viewer").runSync();
// `node_modules` is considered dirty and we've already checked git status below.
sh`cargo publish --allow-dirty`
.cwd("rust/perspective-viewer")
.runSync();
} else {
console.warn(`COMMIT not specified, aborting`);
}
Expand Down

0 comments on commit 075967e

Please sign in to comment.