mirror of
https://github.com/heavyai/heavyai-charting.git
synced 2026-02-01 16:00:04 +00:00
Comment cleanup
This commit is contained in:
parent
7dcb11b8af
commit
a124feff60
@ -260,7 +260,7 @@ export async function getLegendStateFromChart(chart, useMap, selectedLayer) {
|
||||
version: 2.0
|
||||
}
|
||||
} else {
|
||||
// TODO(croot): this can be removed once all raster layer types are
|
||||
// TODO: this can be removed once all raster layer types are
|
||||
// transitioned to the getPrimaryColorScaleName/getLegendDefinitionForProperty
|
||||
// form above
|
||||
const layerState = layer.getState()
|
||||
@ -845,7 +845,7 @@ function legendState_v2(state, useMap) {
|
||||
return {}
|
||||
}
|
||||
const min_size = Math.min(domain.length, range.length)
|
||||
// TODO(croot): may want to consider filling out the auto-gradient here
|
||||
// TODO: may want to consider filling out the auto-gradient here
|
||||
// using a max-number of stops. The best way to do this will most likely
|
||||
// be to create a d3 scale of similar type, and generate new ranges from
|
||||
// it at auto-gradient stops. Unforunately the legendables library will only
|
||||
|
||||
@ -197,7 +197,7 @@ export default function geoChoroplethChart(parent, useMap, chartGroup, mapbox) {
|
||||
|
||||
/* OVERRIDE EXTEND ----------------------------------------------------------*/
|
||||
function accentPoly(label) {
|
||||
const layerNameClass = geoJson(0).name // hack for now as we only allow one layer currently
|
||||
const layerNameClass = geoJson(0).name // Currently limited to single layer support
|
||||
_chart.selectAll("g." + layerNameClass).each(function(d) {
|
||||
if (getKey(0, d) == label) {
|
||||
_chart.accentSelected(this)
|
||||
@ -206,7 +206,7 @@ export default function geoChoroplethChart(parent, useMap, chartGroup, mapbox) {
|
||||
}
|
||||
|
||||
function unAccentPoly(label) {
|
||||
const layerNameClass = geoJson(0).name // hack for now as we only allow one layer currently
|
||||
const layerNameClass = geoJson(0).name // Currently limited to single layer support
|
||||
_chart.selectAll("g." + layerNameClass).each(function(d) {
|
||||
if (getKey(0, d) == label) {
|
||||
_chart.unAccentSelected(this)
|
||||
|
||||
@ -47,7 +47,6 @@ export function heatMapKeyAccessor({ key0 }) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO - remove me. Trying to get TravisCI to work
|
||||
export const heatMapKeyAccessorNoFormat = function({ key0 }, forceMax = false) {
|
||||
if (Array.isArray(key0)) {
|
||||
const keyIndex = forceMax && key0[1] ? 1 : 0
|
||||
|
||||
@ -235,7 +235,7 @@ export default function rasterChart(parent, useMap, chartGroup, _mapboxgl) {
|
||||
}
|
||||
|
||||
if (
|
||||
// pointmap prioritized color hack
|
||||
// Special handling for pointmap prioritized color rendering
|
||||
layer.getState().mark === "point" &&
|
||||
layerName !== "backendScatter" &&
|
||||
layer.getState().encoding.color.prioritizedColor &&
|
||||
@ -379,7 +379,7 @@ export default function rasterChart(parent, useMap, chartGroup, _mapboxgl) {
|
||||
return _chart
|
||||
}
|
||||
|
||||
// TODO(croot): pixel ratio should probably be configured on the backend
|
||||
// TODO: pixel ratio should probably be configured on the backend
|
||||
// rather than here to deal with scenarios where data is used directly
|
||||
// in pixel-space.
|
||||
_chart.usePixelRatio = function(usePixelRatio) {
|
||||
@ -568,7 +568,7 @@ export default function rasterChart(parent, useMap, chartGroup, _mapboxgl) {
|
||||
}
|
||||
|
||||
// if _chart.useLonLat() is not true, the chart bounds have already been projected into mercator space
|
||||
// TODO(adb): could probably collape this into line 353
|
||||
// TODO: could probably collape this into line 353
|
||||
if (
|
||||
_useGeoTypes &&
|
||||
typeof _chart.useLonLat === "function" &&
|
||||
@ -800,7 +800,7 @@ export default function rasterChart(parent, useMap, chartGroup, _mapboxgl) {
|
||||
const vega_metadata = JSON.parse(data.vega_metadata)
|
||||
for (const layerName in _layerNames) {
|
||||
if (typeof _layerNames[layerName]._updateFromMetadata === "function") {
|
||||
// TODO(croot): I don't understand this logic. Why would the selectedLayer
|
||||
// TODO: I don't understand this logic. Why would the selectedLayer
|
||||
// be set only on the existence of the _updateFromMetadata() method?
|
||||
// My guess is that it's an attempt to get the last layer, but there are
|
||||
// so many better ways to get at that.
|
||||
@ -931,7 +931,7 @@ export default function rasterChart(parent, useMap, chartGroup, _mapboxgl) {
|
||||
|
||||
_chart.measureValue = function(value, key) {
|
||||
const customFormatter = _chart.valueFormatter()
|
||||
// hack to undo the popup concatenation like "AVG(arrdelay)"
|
||||
// Parse aggregation function from popup key format (e.g., "AVG(arrdelay)")
|
||||
let keyTrimmed = null
|
||||
if (key) {
|
||||
keyTrimmed = key.replace(/.*\((.*)\).*/, "$1")
|
||||
@ -981,7 +981,7 @@ export default function rasterChart(parent, useMap, chartGroup, _mapboxgl) {
|
||||
const layerName = _layers[i]
|
||||
const layer = _layerNames[layerName]
|
||||
if (layer) {
|
||||
// TODO(croot): can this be improved? I presume only
|
||||
// TODO: can this be improved? I presume only
|
||||
// one popup can be shown at a time
|
||||
if (animate) {
|
||||
layer.hidePopup(_chart, () => {
|
||||
@ -1078,7 +1078,7 @@ function checkMultiYScaleLayers(chart, scales) {
|
||||
mesh2dLayer.length > 0
|
||||
) {
|
||||
// ensure the domain of the y scale is the range set from the mesh2d yDim
|
||||
// TODO(C): need to check how multi 2-D CS's are handled to tell if this is the
|
||||
// TODO: need to check how multi 2-D CS's are handled to tell if this is the
|
||||
// correct approach for setting the y domain or not
|
||||
scales[1].domain = mesh2dLayer[0].yDim().getFilter()[0]
|
||||
// add a new y scale for the terrain layer, updating the name in the layer and setting
|
||||
@ -1128,7 +1128,7 @@ function genLayeredVega(chart) {
|
||||
nullValue: -100
|
||||
}
|
||||
]
|
||||
// TODO(matzy): This can probably be cleaned up now that chart.y2() exists
|
||||
// TODO: This can probably be cleaned up now that chart.y2() exists
|
||||
checkMultiYScaleLayers(chart, scales)
|
||||
|
||||
// NOTE(adb): When geo types are enabled, vega spatial projections are applied and the scales for the x and y properties are not being used. However, we still need the legacy scaling terms to properly size poly popups on hover, which is why _xLatLngBnds, etc are separate scales
|
||||
|
||||
@ -134,7 +134,7 @@ export default function rowChart(parent, chartGroup) {
|
||||
const key = _chart.getMeasureName()
|
||||
// We have no good way of knowing if the valueFormatter has a formatter for the X axis in
|
||||
// particular, since that code is a black box. So we run through a test value and if it returns
|
||||
// `null`, we know it doesn't know how to format it. It's dumb, but it works.
|
||||
// `null`, we know it doesn't know how to format it.
|
||||
const validFormatting = numberFormatter && numberFormatter(0, key) !== null
|
||||
if (validFormatting) {
|
||||
xFormatCache.setTickFormat(d => numberFormatter(d, key))
|
||||
|
||||
@ -226,7 +226,7 @@ export function transition(selections, duration, callback, name) {
|
||||
return s
|
||||
}
|
||||
|
||||
/* somewhat silly, but to avoid duplicating logic */
|
||||
/* to avoid duplicating logic */
|
||||
export function optionalTransition(enable, duration, callback, name) {
|
||||
if (enable) {
|
||||
return function(selection) {
|
||||
|
||||
@ -202,7 +202,7 @@ export default function coordinateGridRasterMixin (_chart, _mapboxgl, browser) {
|
||||
return _maxBounds
|
||||
}
|
||||
|
||||
// TODO(croot): verify max bounds?
|
||||
// TODO: verify max bounds?
|
||||
if (!(maxBounds instanceof Array) || maxBounds.length !== 2 || !(maxBounds[0] instanceof Array) || maxBounds[0].length !== 2 || !(maxBounds[1] instanceof Array) || maxBounds[1].length !== 2) {
|
||||
throw new Error("Invalid bounds argument. A bounds object should be: [[xmin, ymin], [xmax, ymax]]")
|
||||
}
|
||||
@ -707,7 +707,7 @@ export default function coordinateGridRasterMixin (_chart, _mapboxgl, browser) {
|
||||
|
||||
|
||||
if (prevWidth !== _chartBody.style("width") || prevHeight !== _chartBody.style("height")) {
|
||||
// TODO(croot): What about when the margins change?
|
||||
// TODO: What about when the margins change?
|
||||
// That's not truly a resize event
|
||||
_chart.map().fire("resize", {
|
||||
width,
|
||||
@ -879,7 +879,7 @@ export default function coordinateGridRasterMixin (_chart, _mapboxgl, browser) {
|
||||
}
|
||||
_lastXDomain = xdom
|
||||
|
||||
// TODO(croot): support ordinal scales?
|
||||
// TODO: support ordinal scales?
|
||||
// If BE supports ordinal scales for X axis, use
|
||||
// rangeBands here: i.e. x.rangeBands([0, _chart.xAxisLength()], ...)
|
||||
|
||||
@ -1077,7 +1077,7 @@ export default function coordinateGridRasterMixin (_chart, _mapboxgl, browser) {
|
||||
}
|
||||
|
||||
if (text !== "") {
|
||||
// TODO(croot): should add the rotation and labelXPosition here
|
||||
// TODO: should add the rotation and labelXPosition here
|
||||
// As of now (09/02/2016) the chart.css is breaking this.
|
||||
|
||||
if (axisClass === "y2") {
|
||||
|
||||
@ -72,7 +72,7 @@ export default function legendMixin(legend) {
|
||||
|
||||
const bodyNode = body.node()
|
||||
if (bodyNode) {
|
||||
// fix for #4196#issuecomment-376704328
|
||||
// Preserve scroll position when legend is redrawn (dc.js issue #4196)
|
||||
bodyNode.scrollTop = legend._scrollPos
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,8 +264,8 @@ export default function lockAxisMixin(chart) {
|
||||
.domain()
|
||||
.slice()
|
||||
|
||||
// Horrible hack to ensure the inputs aren't inverted from whatever order
|
||||
// the Y axis decides to display. Mea culpa.
|
||||
// Ensure the inputs aren't inverted from whatever order
|
||||
// the Y axis decides to display.
|
||||
let shouldFlipYMinMax = false
|
||||
const isHeatY = chart.isHeatMap && type === "y"
|
||||
if (isHeatY) {
|
||||
|
||||
@ -696,7 +696,7 @@ export default function mapMixin(
|
||||
coordinates: boundsToUse
|
||||
})
|
||||
} else {
|
||||
// for some reason, the source is lost some of the time, so adding it again FE-9833
|
||||
// for some reason, the source is lost some of the time, so adding it again
|
||||
setSourceAndAddLayer(overlayName)
|
||||
}
|
||||
}
|
||||
@ -826,7 +826,6 @@ export default function mapMixin(
|
||||
_lastWidth = width
|
||||
_lastHeight = height
|
||||
|
||||
// this is a dumb hack, but it works and there doesn't seem to be another sensible way.
|
||||
// problem is, mapbox looks to the size of "mapboxgl-canvas-container" to determine the
|
||||
// render size of the canvas, regardless of what we feed it above. if there is an overlay
|
||||
// drawer open, even if it sits at a higher z-index, the canvas size will be calculated
|
||||
|
||||
@ -514,7 +514,7 @@ export function rasterDrawMixin(chart) {
|
||||
|
||||
chart.addDrawControl = (lassoToolSetTypes = LassoToolSetTypes.kStandard) => {
|
||||
if (drawEngine) {
|
||||
// TODO(croot): if the requested tool set types are different,
|
||||
// TODO: if the requested tool set types are different,
|
||||
// should we update the button group controller here?
|
||||
return chart
|
||||
}
|
||||
|
||||
@ -281,13 +281,13 @@ export default function rasterLayerCrossSectionTerrainMixin(_layer) {
|
||||
_layer._addRenderAttrsToPopupColumnSet = function(chart, popupColumnsSet) {
|
||||
// currently no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
_layer._areResultsValidForPopup = function(results) {
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
return true
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ export default function rasterLayerCrossSectionTerrainMixin(_layer) {
|
||||
_layer._displayPopup = function(svgProps) {
|
||||
// currently a no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
return AABox2d.create()
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ export default function rasterLayerCrossSectionTerrainMixin(_layer) {
|
||||
_layer._hidePopup = function(chart, hideCallback) {
|
||||
// currently a no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
}
|
||||
|
||||
_layer._destroyLayer = function() {
|
||||
|
||||
@ -20,7 +20,7 @@ import VegaPropertyOutputState from "./render-vega-lite/VegaPropertyOutputState"
|
||||
import { LEGEND_POSITIONS } from "../chart-addons/stacked-legend"
|
||||
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): this seems like it is used in at least one other layer mixin. Make into a utility somewhere
|
||||
// TODO: this seems like it is used in at least one other layer mixin. Make into a utility somewhere
|
||||
function create_post_filter_transform(post_filters) {
|
||||
const post_filter =
|
||||
post_filters && Array.isArray(post_filters) ? post_filters[0] : null // may change to map when we have more than one postFilter
|
||||
@ -260,13 +260,13 @@ export default function rasterLayerMesh2dMixin(_layer) {
|
||||
_layer._addRenderAttrsToPopupColumnSet = function(chart, popupColumnsSet) {
|
||||
// currently no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
_layer._areResultsValidForPopup = function(results) {
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
return true
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ export default function rasterLayerMesh2dMixin(_layer) {
|
||||
_layer._displayPopup = function(svgProps) {
|
||||
// currently a no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
return AABox2d.create()
|
||||
}
|
||||
|
||||
@ -282,7 +282,7 @@ export default function rasterLayerMesh2dMixin(_layer) {
|
||||
_layer._hidePopup = function(chart, hideCallback) {
|
||||
// currently a no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support mesh2d hit-testing
|
||||
// TODO: needs to be filled in to support mesh2d hit-testing
|
||||
}
|
||||
|
||||
_layer._destroyLayer = function() {
|
||||
|
||||
@ -239,7 +239,6 @@ export default function rasterLayerPointMixin(_layer) {
|
||||
as: alias,
|
||||
// For some reason, we're receiving duplicate tables here, causing headaches w/ export SQL generation
|
||||
// in heavyai-data-layer2. So, just gonna filter them out.
|
||||
// https://heavyai.atlassian.net/browse/FE-14213
|
||||
groupby: [...new Set(transform.groupby)].map((g, i) => ({
|
||||
type: "project",
|
||||
expr: `${isDataExport && i === 0 ? "/*+ cpu_mode */ " : ""}${g}`,
|
||||
@ -701,7 +700,7 @@ export default function rasterLayerPointMixin(_layer) {
|
||||
}
|
||||
|
||||
_layer._genVega = function(chart, layerName, group, query) {
|
||||
// Pointmap prioritized color hack. Need to use the real layer name for crossfilter
|
||||
// Pointmap prioritized color handling: use the actual layer name for crossfilter operations
|
||||
let realLayerName = layerName
|
||||
if (
|
||||
layerName &&
|
||||
|
||||
@ -824,7 +824,7 @@ export default function rasterLayerPolyMixin(_layer) {
|
||||
(i !== _layer.dimension().getDimensionIndex() &&
|
||||
f !== "" &&
|
||||
f !== null &&
|
||||
// Kinda hacky, we don't want to include rowId filter in vega query, but we want everything else
|
||||
// Exclude rowId filter from vega query while including all other filters
|
||||
!f.includes("rowid"))
|
||||
)
|
||||
|
||||
@ -966,7 +966,7 @@ export default function rasterLayerPolyMixin(_layer) {
|
||||
return __displayPopup({ ...svgProps, _vega, _layer, state })
|
||||
}
|
||||
|
||||
// We disabled polygon selection filter from Master layer if the chart has more than one poly layer in 4.7 release, FE-8685.
|
||||
// We disabled polygon selection filter from Master layer if the chart has more than one poly layer in 4.7 release.
|
||||
// Since we run rowid filter on poly selection filter, it is not correct to run same rowid filter for all overlapping poly layers.
|
||||
// We need better UI/UX design for this
|
||||
function chartHasMoreThanOnePolyLayers(chart) {
|
||||
@ -985,7 +985,7 @@ export default function rasterLayerPolyMixin(_layer) {
|
||||
chartHasMoreThanOnePolyLayers(chart)) ||
|
||||
!_onClickFiltering
|
||||
) {
|
||||
// don't filter from Master, FE-8685
|
||||
// don't filter from Master
|
||||
return
|
||||
}
|
||||
const isInverseFilter = Boolean(event && (event.metaKey || event.ctrlKey))
|
||||
|
||||
@ -114,7 +114,6 @@ export default function rasterLayerWindBarbMixin(_layer) {
|
||||
as: alias,
|
||||
// For some reason, we're receiving duplicate tables here, causing headaches w/ export SQL generation
|
||||
// in heavyai-data-layer2. So, just gonna filter them out.
|
||||
// https://heavyai.atlassian.net/browse/FE-14213
|
||||
groupby: [...new Set(transform.groupby)].map((g, i) => ({
|
||||
type: "project",
|
||||
expr: `${isDataExport && i === 0 ? "/*+ cpu_mode */ " : ""}${g}`,
|
||||
@ -213,7 +212,7 @@ export default function rasterLayerWindBarbMixin(_layer) {
|
||||
prop_descriptors.set("y", new PositionChannelDescriptor("y"))
|
||||
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): support geo columns
|
||||
// TODO: support geo columns
|
||||
// prop_descriptors.set(
|
||||
// "longitude",
|
||||
// new GeographicChannelDescriptor("longitude", "x")
|
||||
@ -378,26 +377,26 @@ export default function rasterLayerWindBarbMixin(_layer) {
|
||||
_layer._addRenderAttrsToPopupColumnSet = function(chart, popupColumnsSet) {
|
||||
// currently no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support windbarb hit-testing
|
||||
// TODO: needs to be filled in to support windbarb hit-testing
|
||||
}
|
||||
|
||||
_layer._areResultsValidForPopup = function(results) {
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support windbarb hit-testing
|
||||
// TODO: needs to be filled in to support windbarb hit-testing
|
||||
return true
|
||||
}
|
||||
|
||||
_layer._displayPopup = function(svgProps) {
|
||||
// currently a no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support windbarb hit-testing
|
||||
// TODO: needs to be filled in to support windbarb hit-testing
|
||||
return AABox2d.create()
|
||||
}
|
||||
|
||||
_layer._hidePopup = function(chart, hideCallback) {
|
||||
// currently a no-op
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): needs to be filled in to support windbarb hit-testing
|
||||
// TODO: needs to be filled in to support windbarb hit-testing
|
||||
}
|
||||
|
||||
_layer._destroyLayer = function() {
|
||||
|
||||
@ -65,7 +65,7 @@ export default function rasterLayer(layerType) {
|
||||
}
|
||||
})
|
||||
|
||||
_layer.othersGrouper(false) // TODO(croot): what does othersGrouper in capMixin do exactly?
|
||||
_layer.othersGrouper(false) // TODO: what does othersGrouper in capMixin do exactly?
|
||||
// Always set to false for now, tho user can override.
|
||||
|
||||
if (layerType === "points") {
|
||||
@ -286,13 +286,13 @@ export default function rasterLayer(layerType) {
|
||||
}
|
||||
|
||||
function addPopupColumnToSet(colAttr, popupColSet) {
|
||||
// TODO(croot): getProjectOn for groups requires the two arguments,
|
||||
// TODO: getProjectOn for groups requires the two arguments,
|
||||
// dimension.getProjectOn() doesn't have any args.
|
||||
// Need to come up with a better API for group.getProjectOn()
|
||||
// and improve the api so that "as key0" are not automatically
|
||||
// added to those projection statements.
|
||||
|
||||
// TODO(croot): performance could be improved here with a better
|
||||
// TODO: performance could be improved here with a better
|
||||
// data structure, but probably not an issue given the amount
|
||||
// of popup col attrs to iterate through is small
|
||||
const dim = _layer.group() || _layer.dimension()
|
||||
@ -644,7 +644,7 @@ export default function rasterLayer(layerType) {
|
||||
const overlapSz = AABox2d.getSize(Point2d.create(), overlapBounds)
|
||||
const overlapCtr = AABox2d.getCenter(Point2d.create(), overlapBounds)
|
||||
|
||||
const padding = 6 // in pixels TODO(croot): expose in css?
|
||||
const padding = 6 // in pixels TODO: expose in css?
|
||||
let topOffset = 0
|
||||
|
||||
const popupDiv = parentElem
|
||||
|
||||
@ -283,7 +283,7 @@ export default class ContinuousScale extends ScaleDefinitionObject {
|
||||
// density accumulation will force on clamp
|
||||
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): is this too heavy handed?
|
||||
// TODO: is this too heavy handed?
|
||||
vega_scale_object.clamp = true
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ export default class DiscreteScale extends ScaleDefinitionObject {
|
||||
super._materializeExtraVegaScaleProps(prop_descriptor, vega_scale_obj)
|
||||
if (this.default_value_ !== null) {
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): should we validate the default value?
|
||||
// TODO: should we validate the default value?
|
||||
vega_scale_obj.default = this.default_value_
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ export default class ScaleDefinitionObject extends PropertiesDefinitionInterface
|
||||
|
||||
if (this.null_value_ !== null) {
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): validate null value, at least object-wise?
|
||||
// TODO: validate null value, at least object-wise?
|
||||
vega_scale_obj.nullValue = this.null_value_
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ export default class ValueDefinitionObject extends PropertiesDefinitionInterface
|
||||
if (Object.keys(value_definition_object).length !== 1) {
|
||||
this.error_message = `Value definitions must have only 1 property called value`
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): not sure about this early return in
|
||||
// TODO: not sure about this early return in
|
||||
// a constructor. The caller should check for the error_message
|
||||
// pretty much immediately after.
|
||||
return
|
||||
|
||||
@ -52,7 +52,7 @@ export default class MarkConfigDefinitionObject extends ConfigDefinitionInterfac
|
||||
this.strokeOpacity_ = definition_object.strokeOpacity
|
||||
}
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): make stroke join an enum
|
||||
// TODO: make stroke join an enum
|
||||
this.strokeJoin_ = MarkConfigDefinitionObject.defaults.strokeJoin
|
||||
if (Object.hasOwn(definition_object, "strokeJoin")) {
|
||||
this.strokeJoin_ = definition_object.strokeJoin
|
||||
|
||||
@ -323,7 +323,7 @@ export default class CrossSection2dDefinitionObject extends PropertiesDefinition
|
||||
// vega_mark_prop_obj[vega_prop_name].field = vega_prop_name
|
||||
// }
|
||||
}
|
||||
// TODO(croot): may want to do a Geographic channel check here, but that would require the prop_descriptors input
|
||||
// TODO: may want to do a Geographic channel check here, but that would require the prop_descriptors input
|
||||
// to this function to only be the prop descriptors that were "handled"
|
||||
// else if (prop_descriptor instanceof GeographicChannelDescriptor) {
|
||||
// throw new Error(
|
||||
|
||||
@ -24,7 +24,7 @@ export default class LimitDefinitionObject extends PropertiesDefinitionInterface
|
||||
}
|
||||
this.limit_ = definition_object[LimitDefinitionObject.key]
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): validate limit ranges?
|
||||
// TODO: validate limit ranges?
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
@ -38,7 +38,7 @@ export default class LimitDefinitionObject extends PropertiesDefinitionInterface
|
||||
}
|
||||
this.offset_ = definition_object.offset
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): validate tableSize?
|
||||
// TODO: validate tableSize?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ export default class SampleDefinitionObject extends PropertiesDefinitionInterfac
|
||||
}
|
||||
this.sample_ = definition_object[SampleDefinitionObject.key]
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): validate sample ranges?
|
||||
// TODO: validate sample ranges?
|
||||
|
||||
if (!Object.hasOwn(definition_object, "tableSize")) {
|
||||
throw new Error(
|
||||
@ -39,7 +39,7 @@ export default class SampleDefinitionObject extends PropertiesDefinitionInterfac
|
||||
}
|
||||
this.table_size_ = definition_object.tableSize
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): validate tableSize?
|
||||
// TODO: validate tableSize?
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -154,7 +154,7 @@ export default class PropDescriptor {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
buildDefaultScaleDefinition(parent_info) {
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): move this into a scale-enabled descriptor mixin
|
||||
// TODO: move this into a scale-enabled descriptor mixin
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ export default function scatterMixin(_chart, _mapboxgl, mixinDraw = true) {
|
||||
},
|
||||
resize() {
|
||||
// noop
|
||||
// TODO(croot): send any events to notify the user of a change?
|
||||
// TODO: send any events to notify the user of a change?
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ export default function scatterMixin(_chart, _mapboxgl, mixinDraw = true) {
|
||||
// default to a 0-1 range
|
||||
_xRange = [0, 1]
|
||||
|
||||
// TODO(croot): automatically determine the min/max of the x dimension
|
||||
// TODO: automatically determine the min/max of the x dimension
|
||||
// If we do this, we should cache the x scale and only
|
||||
// do this if the scale or dimension has changed
|
||||
} else {
|
||||
|
||||
@ -54,7 +54,7 @@ export default function stackMixin(_chart) {
|
||||
return d3.functor(true)
|
||||
}
|
||||
if (_chart.isOrdinal()) {
|
||||
// TODO #416
|
||||
// TODO: Handle domain set for ordinal scales
|
||||
// var domainSet = d3.set(xDomain);
|
||||
return function() {
|
||||
return true // domainSet.has(p.x);
|
||||
|
||||
@ -590,7 +590,7 @@ class ScrollZoomHandler extends BaseHandler {
|
||||
// NOTE: the following is currently only designed
|
||||
// to work with linear scales.
|
||||
|
||||
// TODO(croot): come up with a generic extrapolation
|
||||
// TODO: come up with a generic extrapolation
|
||||
// technique for any scale.
|
||||
|
||||
const width = this._chart.effectiveWidth()
|
||||
@ -743,7 +743,7 @@ class DragPanHandler extends BaseHandler {
|
||||
this._fireEvent("movestart", e)
|
||||
}
|
||||
|
||||
// TODO(croot): stop other animated pans/zooms here if/when
|
||||
// TODO: stop other animated pans/zooms here if/when
|
||||
// they're supported.
|
||||
this._drainInertiaBuffer()
|
||||
this._dragInertia.push([Date.now(), pos])
|
||||
@ -851,12 +851,12 @@ class DragPanHandler extends BaseHandler {
|
||||
|
||||
finish()
|
||||
|
||||
// TODO(croot):
|
||||
// TODO:
|
||||
// Do the animated ease-out of the pan like mapbox
|
||||
}
|
||||
|
||||
onTouchEnd(e) {
|
||||
// TODO(croot): check that the event is in the chart window?
|
||||
// TODO: check that the event is in the chart window?
|
||||
if (this._ignoreEvent(e)) {
|
||||
return
|
||||
}
|
||||
@ -866,7 +866,7 @@ class DragPanHandler extends BaseHandler {
|
||||
}
|
||||
|
||||
onMouseUp(e) {
|
||||
// TODO(croot): check that the event is in the chart window?
|
||||
// TODO: check that the event is in the chart window?
|
||||
if (this._ignoreEvent(e)) {
|
||||
return
|
||||
}
|
||||
@ -994,7 +994,7 @@ export default function bindEventHandlers(
|
||||
}
|
||||
|
||||
function onMouseDown(e) {
|
||||
// TODO(croot): if we support animated
|
||||
// TODO: if we support animated
|
||||
// pans/zooms, we want to stop any currently
|
||||
// running animation here first:
|
||||
|
||||
@ -1031,7 +1031,7 @@ export default function bindEventHandlers(
|
||||
|
||||
function onTouchStart(e) {
|
||||
if (isInChart(chart, container, e)) {
|
||||
// TODO(croot): if we support animated
|
||||
// TODO: if we support animated
|
||||
// pans/zooms, we want to stop any currently
|
||||
// running animation here first:
|
||||
if (
|
||||
@ -1110,7 +1110,7 @@ export default function bindEventHandlers(
|
||||
const margins = chart.margins()
|
||||
|
||||
for (let i = 0; i < e.touches.length; i = i + 1) {
|
||||
// TODO(croot): should we only add points that are
|
||||
// TODO: should we only add points that are
|
||||
// within the container?
|
||||
points.push(
|
||||
new mapboxglModule.Point(
|
||||
|
||||
@ -434,7 +434,7 @@ function subdivideArc(
|
||||
circle_descriptor.max_segment_pixel_distance
|
||||
) {
|
||||
// subdivde the line segment at the midpoint of the in-view line segment
|
||||
// TODO(croot): This seems to work 99.5% of the time but could see a jump in the rare case that
|
||||
// TODO: This seems to work 99.5% of the time but could see a jump in the rare case that
|
||||
// the line segment crosses very close to a corner.
|
||||
const line_center_lonlat = tmp_point
|
||||
Point2d.lerp(line_center_lonlat, start_lonlat_pt, end_lonlat_pt, 0.5)
|
||||
|
||||
@ -138,7 +138,7 @@ function _intersect_view_bounds(
|
||||
// Return empty object.
|
||||
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): support other projections?
|
||||
// TODO: support other projections?
|
||||
|
||||
return rtn_obj
|
||||
}
|
||||
@ -190,7 +190,7 @@ function _intersect_view_bounds(
|
||||
if (denominator_t === 0) {
|
||||
// colinear
|
||||
// eslint-disable-next-line no-warning-comments
|
||||
// TODO(croot): this needs filling out in the general case
|
||||
// TODO: this needs filling out in the general case
|
||||
// NOTE: this should never be hit in the LonLatPoly case because of
|
||||
// the delta_x/delta_y === 0 check.
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
* As part of the initiative to upgrade our Mapbox dependency, these
|
||||
* functions have been copied from our forked version of Mapbox so that Mapbox
|
||||
* can be updated independently
|
||||
* - See [FE-8035]
|
||||
*/
|
||||
|
||||
import UnitBezier from "@mapbox/unitbezier"
|
||||
|
||||
@ -209,7 +209,7 @@ export function createVegaAttrMixin(
|
||||
}
|
||||
rtnVal = ordScale(formattedInput)
|
||||
} else if (Array.isArray(domainVals) && domainVals[0] === domainVals[1]) {
|
||||
// handling case where domain min/max are the same (FE-7408)
|
||||
// handling case where domain min/max are the same
|
||||
linearScale.domain(domainVals).range(capAttrObj.range)
|
||||
rtnVal = Math.round(linearScale(input))
|
||||
} else {
|
||||
@ -818,7 +818,7 @@ export function getScales(
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters z-indexed layers and returns non duplicate layer. Z-indexed layers is for temporary hack FE-13136
|
||||
* Filters z-indexed layers and returns non duplicate layer.
|
||||
* For z-indexed layer (layer that has top color category applied), only returns the first z-index, z_0
|
||||
* @param layers
|
||||
* @returns {[]}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user