Skip to content

Commit

Permalink
feat: Track caption and readout font size and text truncation (#1941)
Browse files Browse the repository at this point in the history
- Refactor readout code, set HTML elements CSS props with CSS style when possible to allow it customization: font size, readout and readout elements widthes and so on
- Long track captions, readout names, values and units truncated with ellipsys
- Add tooltips to show not truncated text

See #1715, #1874, #1888
  • Loading branch information
Vladimir-Kokin authored Mar 5, 2024
1 parent fba4db0 commit ff14b41
Show file tree
Hide file tree
Showing 24 changed files with 486 additions and 463 deletions.
29 changes: 5 additions & 24 deletions typescript/packages/well-log-viewer/src/SyncLogViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -985,18 +985,7 @@ class SyncLogViewer extends Component<SyncLogViewerProps, State> {

createRightPanel(): ReactNode {
return (
<div
key="rightPanel"
style={{
flex: "0, 0",
display: "flex",
flexDirection: "column",
height: "100%",
width: "255px",
minWidth: "255px",
maxWidth: "255px",
}}
>
<div key="rightPanel" className="right-panel">
<AxisSelector
header="Primary scale"
axes={this.state.axes}
Expand All @@ -1014,20 +1003,12 @@ class SyncLogViewer extends Component<SyncLogViewerProps, State> {
infos={this.state.infos[index]}
/>
))}
<div style={{ paddingLeft: "10px", display: "flex" }}>
<span>Zoom:</span>
<span
style={{
flex: "1 1 100px",
padding: "0 20px 0 10px",
}}
>
<div className="zoom">
<span className="zoom-label">Zoom:</span>
<span className="zoom-value">
<ZoomSlider
value={this.state.sliderValue}
max={
this.props.welllogOptions?.maxContentZoom ||
256 /*default*/
}
max={this.props.welllogOptions?.maxContentZoom}
onChange={this.onZoomSliderChange}
/>
</span>
Expand Down
72 changes: 32 additions & 40 deletions typescript/packages/well-log-viewer/src/WellLogViewer.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ReactNode } from "react";
import React, { Component } from "react";

import PropTypes from "prop-types";
Expand Down Expand Up @@ -245,6 +246,36 @@ export default class WellLogViewer extends Component<
this.updateReadoutPanel();
}

createRightPanel(): ReactNode {
return (
<div key="rightPanel" className="right-panel">
<AxisSelector
header="Primary scale"
axes={this.state.axes}
axisLabels={this.props.axisTitles}
value={this.state.primaryAxis}
onChange={this.onChangePrimaryAxis}
/>
<InfoPanel
header="Readout"
onGroupClick={this.onInfoGroupClick}
infos={this.state.infos}
/>
<br />
<div className="zoom">
<span className="zoom-label">Zoom:</span>
<span className="zoom-value">
<ZoomSlider
value={this.state.sliderValue}
max={this.props.options?.maxContentZoom}
onChange={this.onZoomSliderChange}
/>
</span>
</div>
</div>
);
}

render(): JSX.Element {
return (
<div style={{ height: "100%", width: "100%", display: "flex" }}>
Expand All @@ -267,46 +298,7 @@ export default class WellLogViewer extends Component<
onContentSelection={this.onContentSelection}
onTemplateChanged={this.onTemplateChanged}
/>
<div
style={{
flex: "0, 0",
display: "flex",
flexDirection: "column",
height: "100%",
width: "255px",
minWidth: "255px",
maxWidth: "255px",
}}
>
<AxisSelector
header="Primary scale"
axes={this.state.axes}
axisLabels={this.props.axisTitles}
value={this.state.primaryAxis}
onChange={this.onChangePrimaryAxis}
/>
<InfoPanel
header="Readout"
onGroupClick={this.onInfoGroupClick}
infos={this.state.infos}
/>
<br />
<div style={{ paddingLeft: "10px", display: "flex" }}>
<span>Zoom:</span>
<span
style={{
flex: "1 1 100px",
padding: "0 20px 0 10px",
}}
>
<ZoomSlider
value={this.state.sliderValue}
max={this.props.options?.maxContentZoom}
onChange={this.onZoomSliderChange}
/>
</span>
</div>
</div>
{this.createRightPanel()}
</div>
);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ff14b41

Please sign in to comment.