Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@influxdata/giraffe

Package Overview
Dependencies
Maintainers
18
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@influxdata/giraffe - npm Package Compare versions

Comparing version 0.17.2 to 0.17.3

dist/utils/fixtures/tooltip.d.ts

2

dist/constants/columnKeys.d.ts

@@ -8,1 +8,3 @@ export declare const X_MIN = "xMin";

export declare const SYMBOL = "__symbol";
export declare const STACKED_LINE_CUMULATIVE = "cumulative";
export declare const LINE_COUNT = "lines";

2

package.json
{
"name": "@influxdata/giraffe",
"version": "0.17.2",
"version": "0.17.3",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -11,1 +11,3 @@ // Computed column names in binned tables (heatmap, histogram)

export const SYMBOL = '__symbol'
export const STACKED_LINE_CUMULATIVE = 'cumulative'
export const LINE_COUNT = 'lines'

@@ -10,2 +10,7 @@ import {

} from '../types'
import {
FILL,
STACKED_LINE_CUMULATIVE,
LINE_COUNT,
} from '../constants/columnKeys'

@@ -16,2 +21,37 @@ import {getDomainDataFromLines} from './lineData'

const orderDataByValue = (
originalOrder: number[],
nextOrder: number[],
data: Array<any>
) => {
const dataMap = {}
originalOrder.forEach((place, index) => (dataMap[place] = data[index]))
return nextOrder.map(place => dataMap[place])
}
const getDataSortOrder = (
lineData: LineData,
hoveredRowIndices: number[],
position: LinePosition
): number[] => {
if (position === 'overlaid') {
return hoveredRowIndices
}
const dataMap = {}
const measurementValues = Object.keys(lineData).reduce(
(accumulator, id) => accumulator.concat(lineData[id][DomainLabel.Y]),
[]
)
const sortable = []
hoveredRowIndices.forEach(hoveredRowIndex => {
if (!dataMap[measurementValues[hoveredRowIndex]]) {
dataMap[measurementValues[hoveredRowIndex]] = []
}
dataMap[measurementValues[hoveredRowIndex]].push(hoveredRowIndex)
sortable.push(measurementValues[hoveredRowIndex])
})
sortable.sort((first, second) => second - first)
return sortable.map(measurement => dataMap[measurement].shift())
}
export const getRangeLabel = (min: number, max: number, formatter): string => {

@@ -65,6 +105,11 @@ let label = ''

): TooltipData => {
const sortOrder = getDataSortOrder(lineData, hoveredRowIndices, position)
const xColData = table.getColumn(xColKey, 'number')
const yColData = table.getColumn(yColKey, 'number')
const groupColData = table.getColumn(groupColKey, 'number')
const colors = hoveredRowIndices.map(i => fillScale(groupColData[i]))
const colors = orderDataByValue(
hoveredRowIndices,
sortOrder,
hoveredRowIndices.map(i => fillScale(groupColData[i]))
)
const xFormatter = getValueFormatter(xColKey)

@@ -86,3 +131,7 @@ const yFormatter = getValueFormatter(yColKey)

colors,
values: hoveredRowIndices.map(i => yFormatter(yColData[i])),
values: orderDataByValue(
hoveredRowIndices,
sortOrder,
hoveredRowIndices.map(i => yFormatter(yColData[i]))
),
}

@@ -93,14 +142,29 @@

tooltipAdditionalColumns.push({
key: yColKey,
name: 'cumulative',
key: STACKED_LINE_CUMULATIVE,
name: STACKED_LINE_CUMULATIVE,
type: table.getColumnType(yColKey),
colors,
values: hoveredRowIndices.map(i => {
const cumulativeColData = getDomainDataFromLines(
lineData,
DomainLabel.Y
)
return yFormatter(cumulativeColData[i])
}),
values: orderDataByValue(
hoveredRowIndices,
sortOrder,
hoveredRowIndices.map(i => {
const cumulativeColData = getDomainDataFromLines(
lineData,
DomainLabel.Y
)
return yFormatter(cumulativeColData[i])
})
),
})
tooltipAdditionalColumns.push({
key: LINE_COUNT,
name: LINE_COUNT,
type: table.getColumnType(FILL),
colors,
values: orderDataByValue(
hoveredRowIndices,
sortOrder,
hoveredRowIndices.map(i => Number(table.getColumn(FILL)[i]) + 1)
),
})
}

@@ -110,3 +174,3 @@

table,
hoveredRowIndices,
sortOrder,
fillColKeys,

@@ -113,0 +177,0 @@ getValueFormatter,

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc