Skip to content

Commit

Permalink
Merge branch 'lineup-v4' into sgratzl/config
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkh committed Mar 20, 2020
2 parents e0df5fc + 80cad89 commit 26f5d3b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/renderer/HistogramCellRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {normalizedStatsBuilder, IStatistics, round, getNumberOfBins} from '../internal';
import {normalizedStatsBuilder, IStatistics, getNumberOfBins} from '../internal';
import {Column, IDataRow, IOrderedGroup, INumberColumn, INumbersColumn, isNumberColumn, isNumbersColumn, IMapAbleColumn, isMapAbleColumn} from '../model';
import InputNumberDialog from '../ui/dialogs/InputNumberDialog';
import {colorOf} from './impose';
Expand Down Expand Up @@ -147,13 +147,14 @@ function createFilterInfo(col: IMapAbleColumn): IFilterInfo<number> {

function createFilterContext(col: IMapAbleColumn, context: IRenderContext): IFilterContext<number> {
const domain = col.getMapping().domain;
const format = col.getNumberFormat();
const percent = (v: number) => Math.round(100 * (v - domain[0]) / (domain[1] - domain[0]));
const unpercent = (v: number) => ((v / 100) * (domain[1] - domain[0]) + domain[0]);
return {
percent,
unpercent,
domain: <[number, number]>domain,
format: (v) => round(v, 2).toString(),
format,
setFilter: (filterMissing, minValue, maxValue) => col.setFilter({
filterMissing,
min: minValue === domain[0] ? NaN : minValue,
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/histogram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function histogramUpdate<T>(n: HTMLElement, stats: IHistogramLike<T>, unf
* @internal
*/
export function mappingHintTemplate(range: [string, string]) {
return `<span class="${cssClass('mapping-hint')}">${range[0]}</span><span class="${cssClass('mapping-hint')}">${range[1]}</span>`;
return `<span class="${cssClass('mapping-hint')}" title="${range[0]}">${range[0]}</span><span class="${cssClass('mapping-hint')}" title="${range[1]}">${range[1]}</span>`;
}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/styles/_vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ $lu_taggle_border_color: #6d6c6c !default;
$lu_assets: './assets' !default;
$lu_use_font_awesome: false !default;

/**
* Width of the drag handler text of the histogram filter
*/
$lu_histogram_drag_hint_width: 7em !default;

@mixin user_select_none() {
-moz-user-select: none;
-webkit-user-select: none;
Expand Down
4 changes: 2 additions & 2 deletions src/styles/renderer/_histogram.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ span.#{$lu_css_prefix}-mapping-hint {
content: attr(data-value);
position: absolute;
bottom: -15px;
width: 5em;
width: $lu_histogram_drag_hint_width;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
Expand All @@ -110,7 +110,7 @@ span.#{$lu_css_prefix}-mapping-hint {
.#{$lu_css_prefix}-histogram-min.#{$lu_css_prefix}-swap-hint,
.#{$lu_css_prefix}-histogram-max:not(.#{$lu_css_prefix}-swap-hint) {
&::before {
left: -5em;
left: -$lu_histogram_drag_hint_width;
text-align: right;
}
}
Expand Down

0 comments on commit 26f5d3b

Please sign in to comment.