Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f6e9344
feat: create common code editor dialog
seankmartin Jun 6, 2025
949da74
feat: include a close button in the footer
seankmartin Jun 6, 2025
ffafb94
fix: license info on new files
seankmartin Jun 6, 2025
e969636
refactor: remove uneeded control over top row class
seankmartin Jun 10, 2025
8569247
refactor: remove uneeded css around sizing in overlay mode
seankmartin Jun 10, 2025
f165eff
refactor: normalise button naming
seankmartin Jun 10, 2025
7b97d6f
fix: avoid any overlaps between code gutter and header/footer border
seankmartin Jun 10, 2025
564c54d
feat: add line numbers to shader code
seankmartin Jun 10, 2025
05685f3
fix: add class to apply button
seankmartin Jun 25, 2025
7610432
fix: don't change styling with !important flag
seankmartin Jun 25, 2025
37806b9
feat: reduce size of code overlay a little in height
seankmartin Jun 25, 2025
a4ed9f1
feat: add class for download button
seankmartin Jun 25, 2025
f3ccfcc
feat: add framed dialog base class
seankmartin Jul 7, 2025
15488f2
refactor: bring code dialog up a level for more reuse
seankmartin Jul 7, 2025
1692934
feat: add line numbers for now to both.
seankmartin Jul 7, 2025
e86378a
refactor: reduce code in screenshot with new shared frame
seankmartin Jul 7, 2025
b9e140c
fix: correct styles after combining
seankmartin Jul 7, 2025
16085eb
fix: small styling fixes
seankmartin Jul 8, 2025
db43038
fix: correct hover states in screenshot modal
seankmartin Jul 8, 2025
7338d0d
feat: reuse button style from screenshot
seankmartin Jul 8, 2025
17ec624
refactor: remove uneeded styling
seankmartin Jul 8, 2025
4f7132a
Revert "feat: reuse button style from screenshot"
seankmartin Jul 8, 2025
6b75dc1
fix: add hover state to screenshot button
seankmartin Jul 8, 2025
851a079
style: format
seankmartin Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 4 additions & 15 deletions src/layer/annotation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
} from "#src/layer/index.js";
import type { LoadedDataSubsource } from "#src/layer/layer_data_source.js";
import { SegmentationUserLayer } from "#src/layer/segmentation/index.js";
import { Overlay } from "#src/overlay.js";
import { getWatchableRenderLayerTransform } from "#src/render_coordinate_transform.js";
import { RenderLayerRole } from "#src/renderlayer.js";
import type { SegmentationDisplayState } from "#src/segmentation_display_state/frontend.js";
Expand Down Expand Up @@ -743,16 +742,6 @@ function makeShaderCodeWidget(layer: AnnotationUserLayer) {
});
}

class ShaderCodeOverlay extends Overlay {
codeWidget: ShaderCodeWidget;
constructor(public layer: AnnotationUserLayer) {
super();
this.codeWidget = this.registerDisposer(makeShaderCodeWidget(this.layer));
this.content.appendChild(this.codeWidget.element);
this.codeWidget.textEditor.refresh();
}
}

class RenderingOptionsTab extends Tab {
codeWidget: ShaderCodeWidget;
constructor(public layer: AnnotationUserLayer) {
Expand Down Expand Up @@ -806,13 +795,13 @@ class RenderingOptionsTab extends Tab {
element.appendChild(
makeShaderCodeWidgetTopRow(
this.layer,
this.codeWidget,
ShaderCodeOverlay,
this.codeWidget.element,
makeShaderCodeWidget,
{
title: "Documentation on image layer rendering",
title: "Documentation on annotation layer rendering",
href: "https://github.com/google/neuroglancer/blob/master/src/annotation/rendering.md",
type: "Annotation",
},
"neuroglancer-annotation-dropdown-shader-top-row",
),
);

Expand Down
6 changes: 0 additions & 6 deletions src/layer/annotation/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
flex-shrink: 0;
}

.neuroglancer-annotation-dropdown-shader-top-row {
display: flex;
flex-direction: row;
align-items: center;
}

.neuroglancer-annotation-shader-property-list {
max-height: 8em;
overflow: auto;
Expand Down
18 changes: 3 additions & 15 deletions src/layer/image/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import {
UserLayer,
} from "#src/layer/index.js";
import type { LoadedDataSubsource } from "#src/layer/layer_data_source.js";
import { Overlay } from "#src/overlay.js";
import { getChannelSpace } from "#src/render_coordinate_transform.js";
import {
RenderScaleHistogram,
Expand Down Expand Up @@ -544,13 +543,13 @@ class RenderingOptionsTab extends Tab {
element.appendChild(
makeShaderCodeWidgetTopRow(
this.layer,
this.codeWidget,
ShaderCodeOverlay,
this.codeWidget.element,
makeShaderCodeWidget,
{
title: "Documentation on image layer rendering",
href: "https://github.com/google/neuroglancer/blob/master/src/sliceview/image_layer_rendering.md",
type: "Image",
},
"neuroglancer-image-dropdown-top-row",
),
);
element.appendChild(
Expand All @@ -576,17 +575,6 @@ class RenderingOptionsTab extends Tab {
}
}

class ShaderCodeOverlay extends Overlay {
codeWidget: ShaderCodeWidget;
constructor(public layer: ImageUserLayer) {
super();
this.codeWidget = this.registerDisposer(makeShaderCodeWidget(this.layer));
this.content.classList.add("neuroglancer-image-layer-shader-overlay");
this.content.appendChild(this.codeWidget.element);
this.codeWidget.textEditor.refresh();
}
}

registerLayerType(ImageUserLayer);
registerVolumeLayerType(VolumeType.IMAGE, ImageUserLayer);
// Use ImageUserLayer as a fallback layer type if there is a `volume` subsource.
Expand Down
11 changes: 0 additions & 11 deletions src/layer/image/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@
border: 1px solid transparent;
}

.neuroglancer-image-dropdown-top-row {
display: flex;
flex-direction: row;
align-items: center;
}

.neuroglancer-image-layer-shader-overlay .neuroglancer-shader-code-widget {
width: 80vw;
height: 80vh;
}

.neuroglancer-selection-details-value-grid {
display: grid;
grid-auto-rows: auto;
Expand Down
12 changes: 0 additions & 12 deletions src/layer/segmentation/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@
height: 6em;
}

.neuroglancer-segmentation-dropdown-skeleton-shader-header {
display: flex;
flex-direction: row;
align-items: center;
}

.neuroglancer-segmentation-layer-skeleton-shader-overlay
.neuroglancer-shader-code-widget {
width: 80vw;
height: 80vh;
}

.neuroglancer-segment-list-entry {
display: flex;
flex-direction: row;
Expand Down
27 changes: 5 additions & 22 deletions src/layer/single_mesh/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
UserLayer,
} from "#src/layer/index.js";
import type { LoadedDataSubsource } from "#src/layer/layer_data_source.js";
import { Overlay } from "#src/overlay.js";
import type { VertexAttributeInfo } from "#src/single_mesh/base.js";
import {
getShaderAttributeType,
Expand Down Expand Up @@ -139,7 +138,7 @@ function makeShaderCodeWidget(layer: SingleMeshUserLayer) {
});
}

class VertexAttributeWidget extends RefCounted {
export class VertexAttributeWidget extends RefCounted {
element = document.createElement("div");
constructor(
public attributes: WatchableValueInterface<
Expand Down Expand Up @@ -215,13 +214,13 @@ class DisplayOptionsTab extends Tab {
element.appendChild(
makeShaderCodeWidgetTopRow(
this.layer,
this.codeWidget,
ShaderCodeOverlay,
this.codeWidget.element,
makeShaderCodeWidget,
{
title: "Documentation on image layer rendering",
title: "Documentation on mesh rendering",
href: "https://github.com/google/neuroglancer/blob/master/src/sliceview/image_layer_rendering.md",
type: "Mesh",
},
"neuroglancer-single-mesh-dropdown-top-row",
),
);
element.appendChild(this.attributeWidget.element);
Expand All @@ -239,22 +238,6 @@ class DisplayOptionsTab extends Tab {
}
}

class ShaderCodeOverlay extends Overlay {
attributeWidget: VertexAttributeWidget;
codeWidget: ShaderCodeWidget;
constructor(public layer: SingleMeshUserLayer) {
super();
this.attributeWidget = this.registerDisposer(
makeVertexAttributeWidget(layer),
);
this.codeWidget = this.registerDisposer(makeShaderCodeWidget(layer));
this.content.classList.add("neuroglancer-single-mesh-layer-shader-overlay");
this.content.appendChild(this.attributeWidget.element);
this.content.appendChild(this.codeWidget.element);
this.codeWidget.textEditor.refresh();
}
}

registerLayerType(SingleMeshUserLayer);
registerLayerTypeDetector((subsource) => {
if (subsource.singleMesh !== undefined) {
Expand Down
18 changes: 0 additions & 18 deletions src/layer/single_mesh/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@

.neuroglancer-single-mesh-dropdown .neuroglancer-shader-code-widget {
height: 6em;
width: 60ch;
border: 1px solid transparent;
}

.neuroglancer-single-mesh-dropdown-top-row {
display: flex;
flex-direction: row;
align-items: center;
}

.neuroglancer-single-mesh-shader-overlay .neuroglancer-shader-code-widget {
width: 80vw;
height: 80vh;
}

.neuroglancer-single-mesh-attribute-widget {
Expand All @@ -43,11 +30,6 @@
grid-template-columns: [type] auto [name] auto [range] auto;
}

.neuroglancer-single-mesh-layer-shader-overlay
.neuroglancer-single-mesh-attribute-widget {
max-height: 20vh;
}

.neuroglancer-single-mesh-attribute {
font-family: monospace;
display: contents;
Expand Down
63 changes: 59 additions & 4 deletions src/overlay.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,78 @@
* limitations under the License.
*/

.overlay {
.neuroglancer-overlay {
height: 100%;
width: 100%;
position: fixed;
z-index: 99;
z-index: 100;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
}

.overlay-content {
.neuroglancer-overlay-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: white;
z-index: 100;
color: black;
padding: 1em;
}

.neuroglancer-framed-dialog:focus-visible {
outline: none;
}

.neuroglancer-framed-dialog-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.5rem 1.5rem;
border-bottom: 1px solid #ccc;
height: 2rem;
margin-bottom: 1px;
}

.neuroglancer-framed-dialog-body {
display: flex;
padding: 0 1.5rem;
overflow: auto;
}

.neuroglancer-framed-dialog-title {
margin-right: auto;
font-size: large;
font-weight: bold;
color: #333;
}

.neuroglancer-framed-dialog-footer {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 1.5rem;
border-top: 1px solid #ccc;
margin-top: 1px;
}

.neuroglancer-framed-dialog-primary-button {
margin-left: auto;
}

.neuroglancer-framed-dialog-close-icon {
background-color: transparent;
border: none;
padding: 0;
}

.neuroglancer-framed-dialog-close-icon svg {
stroke: #141415;
opacity: 0.6;
}

.neuroglancer-framed-dialog-close-icon:hover svg {
stroke: white;
opacity: 1;
}
Loading
Loading