mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: fix .eslintignore
to only ignore folder paths at the root (#72032)
fix eslintignore to only ignore folder paths at the root
This commit is contained in:
parent
892a0d2e5e
commit
01369e6aff
@ -2682,6 +2682,23 @@ exports[`better eslint`] = {
|
|||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
],
|
],
|
||||||
|
"public/app/features/live/data/StreamingDataFrame.ts:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "4"],
|
||||||
|
[0, 0, 0, "Unexpected any. Specify a different type.", "5"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "6"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "7"]
|
||||||
|
],
|
||||||
|
"public/app/features/live/data/amendTimeSeries.ts:5381": [
|
||||||
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "2"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "3"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "4"]
|
||||||
|
],
|
||||||
"public/app/features/live/index.ts:5381": [
|
"public/app/features/live/index.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
@ -4853,6 +4870,26 @@ exports[`better eslint`] = {
|
|||||||
"public/app/plugins/panel/geomap/layers/basemaps/esri.ts:5381": [
|
"public/app/plugins/panel/geomap/layers/basemaps/esri.ts:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
|
"public/app/plugins/panel/geomap/layers/data/dayNightLayer.tsx:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
|
],
|
||||||
|
"public/app/plugins/panel/geomap/layers/data/geojsonDynamic.ts:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
|
],
|
||||||
|
"public/app/plugins/panel/geomap/layers/data/heatMap.tsx:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
|
],
|
||||||
|
"public/app/plugins/panel/geomap/layers/data/markersLayer.tsx:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
|
],
|
||||||
|
"public/app/plugins/panel/geomap/layers/data/photosLayer.tsx:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
|
],
|
||||||
|
"public/app/plugins/panel/geomap/layers/data/routeLayer.tsx:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "1"],
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "2"]
|
||||||
|
],
|
||||||
"public/app/plugins/panel/geomap/layers/registry.ts:5381": [
|
"public/app/plugins/panel/geomap/layers/registry.ts:5381": [
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
[0, 0, 0, "Unexpected any. Specify a different type.", "0"],
|
||||||
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
|
||||||
|
@ -3,23 +3,23 @@
|
|||||||
.yarn
|
.yarn
|
||||||
build
|
build
|
||||||
compiled
|
compiled
|
||||||
data
|
/data
|
||||||
deployment_tools_config.json
|
deployment_tools_config.json
|
||||||
devenv
|
/devenv
|
||||||
dist
|
dist
|
||||||
e2e/tmp
|
/e2e/tmp
|
||||||
node_modules
|
node_modules
|
||||||
pkg
|
/pkg
|
||||||
public/lib/monaco
|
/public/lib/monaco
|
||||||
scripts/grafana-server/tmp
|
/scripts/grafana-server/tmp
|
||||||
vendor
|
vendor
|
||||||
|
|
||||||
# TS generate from cue by cuetsy
|
# TS generate from cue by cuetsy
|
||||||
**/*.gen.ts
|
**/*.gen.ts
|
||||||
|
|
||||||
# Auto-generated internationalization files
|
# Auto-generated internationalization files
|
||||||
public/locales/_build/
|
/public/locales/_build/
|
||||||
public/locales/**/*.js
|
/public/locales/**/*.js
|
||||||
|
|
||||||
# Auto-generated icon file
|
# Auto-generated icon file
|
||||||
packages/grafana-ui/src/components/Icon/iconBundle.ts
|
/packages/grafana-ui/src/components/Icon/iconBundle.ts
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { DataFrame, DataFrameJSON, FieldType, getFieldDisplayName, reduceField, ReducerID } from '@grafana/data';
|
import { DataFrame, DataFrameJSON, FieldType, getFieldDisplayName, reduceField, ReducerID } from '@grafana/data';
|
||||||
import { StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime';
|
import { StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime';
|
||||||
|
|
||||||
import { closestIdx, getStreamingFrameOptions, StreamingDataFrame } from './StreamingDataFrame';
|
import { closestIdx, getStreamingFrameOptions, StreamingDataFrame } from './StreamingDataFrame';
|
||||||
|
|
||||||
describe('Streaming JSON', () => {
|
describe('Streaming JSON', () => {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import { AlignedData } from 'uplot';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DataFrame,
|
DataFrame,
|
||||||
DataFrameJSON,
|
DataFrameJSON,
|
||||||
@ -15,7 +17,6 @@ import {
|
|||||||
import { join } from '@grafana/data/src/transformations/transformers/joinDataFrames';
|
import { join } from '@grafana/data/src/transformations/transformers/joinDataFrames';
|
||||||
import { StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime/src/services/live';
|
import { StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime/src/services/live';
|
||||||
import { renderLegendFormat } from 'app/plugins/datasource/prometheus/legend';
|
import { renderLegendFormat } from 'app/plugins/datasource/prometheus/legend';
|
||||||
import { AlignedData } from 'uplot';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream packet info is attached to StreamingDataFrames and indicate how many
|
* Stream packet info is attached to StreamingDataFrames and indicate how many
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { DataQueryResponseData, isDataFrame } from '@grafana/data';
|
import { DataQueryResponseData, isDataFrame } from '@grafana/data';
|
||||||
|
|
||||||
import { StreamingDataFrame } from './StreamingDataFrame';
|
import { StreamingDataFrame } from './StreamingDataFrame';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,3 +1,16 @@
|
|||||||
|
import Feature from 'ol/Feature';
|
||||||
|
import Map from 'ol/Map';
|
||||||
|
import { Coordinate } from 'ol/coordinate';
|
||||||
|
import { MultiLineString } from 'ol/geom';
|
||||||
|
import Point from 'ol/geom/Point';
|
||||||
|
import { Group as LayerGroup } from 'ol/layer';
|
||||||
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
|
import { fromLonLat } from 'ol/proj';
|
||||||
|
import VectorSource from 'ol/source/Vector';
|
||||||
|
import { Fill, Stroke, Style, Circle } from 'ol/style';
|
||||||
|
import DayNight from 'ol-ext/source/DayNight';
|
||||||
|
import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MapLayerRegistryItem,
|
MapLayerRegistryItem,
|
||||||
MapLayerOptions,
|
MapLayerOptions,
|
||||||
@ -7,19 +20,6 @@ import {
|
|||||||
DataHoverEvent,
|
DataHoverEvent,
|
||||||
DataHoverClearEvent,
|
DataHoverClearEvent,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import Map from 'ol/Map';
|
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
|
||||||
import VectorSource from 'ol/source/Vector';
|
|
||||||
import { Fill, Stroke, Style, Circle } from 'ol/style';
|
|
||||||
import { Group as LayerGroup } from 'ol/layer';
|
|
||||||
import Feature from 'ol/Feature';
|
|
||||||
import Point from 'ol/geom/Point';
|
|
||||||
|
|
||||||
import DayNight from 'ol-ext/source/DayNight';
|
|
||||||
import { fromLonLat } from 'ol/proj';
|
|
||||||
import { Subscription } from 'rxjs';
|
|
||||||
import { MultiLineString } from 'ol/geom';
|
|
||||||
import { Coordinate } from 'ol/coordinate';
|
|
||||||
|
|
||||||
export enum ShowTime {
|
export enum ShowTime {
|
||||||
From = 'from',
|
From = 'from',
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
import { FeatureLike } from 'ol/Feature';
|
||||||
|
import OlMap from 'ol/Map';
|
||||||
|
import { unByKey } from 'ol/Observable';
|
||||||
|
import GeoJSON from 'ol/format/GeoJSON';
|
||||||
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
|
import VectorSource from 'ol/source/Vector';
|
||||||
|
import { Fill, Stroke, Style } from 'ol/style';
|
||||||
|
import { ReplaySubject } from 'rxjs';
|
||||||
|
import { map as rxjsmap, first } from 'rxjs/operators';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MapLayerRegistryItem,
|
MapLayerRegistryItem,
|
||||||
MapLayerOptions,
|
MapLayerOptions,
|
||||||
@ -6,25 +16,18 @@ import {
|
|||||||
PluginState,
|
PluginState,
|
||||||
EventBus,
|
EventBus,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import OlMap from 'ol/Map';
|
import { ComparisonOperation } from '@grafana/schema';
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
import { findField } from 'app/features/dimensions';
|
||||||
import VectorSource from 'ol/source/Vector';
|
|
||||||
import GeoJSON from 'ol/format/GeoJSON';
|
import { StyleEditor } from '../../editor/StyleEditor';
|
||||||
import { unByKey } from 'ol/Observable';
|
import { polyStyle } from '../../style/markers';
|
||||||
import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule';
|
|
||||||
import { FeatureRuleConfig, FeatureStyleConfig } from '../../types';
|
|
||||||
import { Fill, Stroke, Style } from 'ol/style';
|
|
||||||
import { FeatureLike } from 'ol/Feature';
|
|
||||||
import { defaultStyleConfig, StyleConfig, StyleConfigState } from '../../style/types';
|
import { defaultStyleConfig, StyleConfig, StyleConfigState } from '../../style/types';
|
||||||
import { getStyleConfigState } from '../../style/utils';
|
import { getStyleConfigState } from '../../style/utils';
|
||||||
import { polyStyle } from '../../style/markers';
|
import { FeatureRuleConfig, FeatureStyleConfig } from '../../types';
|
||||||
import { StyleEditor } from '../../editor/StyleEditor';
|
import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule';
|
||||||
import { ReplaySubject } from 'rxjs';
|
|
||||||
import { map as rxjsmap, first } from 'rxjs/operators';
|
|
||||||
import { getLayerPropertyInfo } from '../../utils/getFeatures';
|
import { getLayerPropertyInfo } from '../../utils/getFeatures';
|
||||||
import { findField } from 'app/features/dimensions';
|
|
||||||
import { getStyleDimension, getPublicGeoJSONFiles } from '../../utils/utils';
|
import { getStyleDimension, getPublicGeoJSONFiles } from '../../utils/utils';
|
||||||
import { ComparisonOperation } from '@grafana/schema';
|
|
||||||
|
|
||||||
export interface DynamicGeoJSONMapperConfig {
|
export interface DynamicGeoJSONMapperConfig {
|
||||||
// URL for a geojson file
|
// URL for a geojson file
|
||||||
@ -87,7 +90,7 @@ export const dynamicGeoJSONLayer: MapLayerRegistryItem<DynamicGeoJSONMapperConfi
|
|||||||
|
|
||||||
const key = source.on('change', () => {
|
const key = source.on('change', () => {
|
||||||
//one geojson loads
|
//one geojson loads
|
||||||
if (source.getState() == 'ready') {
|
if (source.getState() === 'ready') {
|
||||||
unByKey(key);
|
unByKey(key);
|
||||||
features.next(source.getFeatures());
|
features.next(source.getFeatures());
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
import { FeatureLike } from 'ol/Feature';
|
||||||
|
import Map from 'ol/Map';
|
||||||
|
import { unByKey } from 'ol/Observable';
|
||||||
|
import GeoJSON from 'ol/format/GeoJSON';
|
||||||
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
|
import VectorSource from 'ol/source/Vector';
|
||||||
|
import { Style } from 'ol/style';
|
||||||
|
import { ReplaySubject } from 'rxjs';
|
||||||
|
import { map as rxjsmap, first } from 'rxjs/operators';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MapLayerRegistryItem,
|
MapLayerRegistryItem,
|
||||||
MapLayerOptions,
|
MapLayerOptions,
|
||||||
@ -5,25 +15,18 @@ import {
|
|||||||
PluginState,
|
PluginState,
|
||||||
EventBus,
|
EventBus,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import Map from 'ol/Map';
|
import { ComparisonOperation } from '@grafana/schema';
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
|
||||||
import VectorSource from 'ol/source/Vector';
|
|
||||||
import GeoJSON from 'ol/format/GeoJSON';
|
|
||||||
import { unByKey } from 'ol/Observable';
|
|
||||||
import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule';
|
|
||||||
import { FeatureRuleConfig, FeatureStyleConfig } from '../../types';
|
|
||||||
import { Style } from 'ol/style';
|
|
||||||
import { FeatureLike } from 'ol/Feature';
|
|
||||||
import { GeomapStyleRulesEditor } from '../../editor/GeomapStyleRulesEditor';
|
import { GeomapStyleRulesEditor } from '../../editor/GeomapStyleRulesEditor';
|
||||||
|
import { StyleEditor } from '../../editor/StyleEditor';
|
||||||
|
import { polyStyle } from '../../style/markers';
|
||||||
import { defaultStyleConfig, StyleConfig, StyleConfigState } from '../../style/types';
|
import { defaultStyleConfig, StyleConfig, StyleConfigState } from '../../style/types';
|
||||||
import { getStyleConfigState } from '../../style/utils';
|
import { getStyleConfigState } from '../../style/utils';
|
||||||
import { polyStyle } from '../../style/markers';
|
import { FeatureRuleConfig, FeatureStyleConfig } from '../../types';
|
||||||
import { StyleEditor } from '../../editor/StyleEditor';
|
import { checkFeatureMatchesStyleRule } from '../../utils/checkFeatureMatchesStyleRule';
|
||||||
import { ReplaySubject } from 'rxjs';
|
|
||||||
import { map as rxjsmap, first } from 'rxjs/operators';
|
|
||||||
import { getLayerPropertyInfo } from '../../utils/getFeatures';
|
import { getLayerPropertyInfo } from '../../utils/getFeatures';
|
||||||
import { getPublicGeoJSONFiles } from '../../utils/utils';
|
import { getPublicGeoJSONFiles } from '../../utils/utils';
|
||||||
import { ComparisonOperation } from '@grafana/schema';
|
|
||||||
|
|
||||||
export interface GeoJSONMapperConfig {
|
export interface GeoJSONMapperConfig {
|
||||||
// URL for a geojson file
|
// URL for a geojson file
|
||||||
@ -81,7 +84,7 @@ export const geojsonLayer: MapLayerRegistryItem<GeoJSONMapperConfig> = {
|
|||||||
|
|
||||||
const key = source.on('change', () => {
|
const key = source.on('change', () => {
|
||||||
//one geojson loads
|
//one geojson loads
|
||||||
if (source.getState() == 'ready') {
|
if (source.getState() === 'ready') {
|
||||||
unByKey(key);
|
unByKey(key);
|
||||||
features.next(source.getFeatures());
|
features.next(source.getFeatures());
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
import Map from 'ol/Map';
|
||||||
|
import { Point } from 'ol/geom';
|
||||||
|
import * as layer from 'ol/layer';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
EventBus,
|
EventBus,
|
||||||
FieldType,
|
FieldType,
|
||||||
@ -7,14 +11,11 @@ import {
|
|||||||
MapLayerRegistryItem,
|
MapLayerRegistryItem,
|
||||||
PanelData,
|
PanelData,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import Map from 'ol/Map';
|
import { ScaleDimensionConfig } from '@grafana/schema';
|
||||||
import * as layer from 'ol/layer';
|
|
||||||
import { getLocationMatchers } from 'app/features/geo/utils/location';
|
|
||||||
import { getScaledDimension } from 'app/features/dimensions';
|
import { getScaledDimension } from 'app/features/dimensions';
|
||||||
import { ScaleDimensionEditor } from 'app/features/dimensions/editors';
|
import { ScaleDimensionEditor } from 'app/features/dimensions/editors';
|
||||||
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
||||||
import { Point } from 'ol/geom';
|
import { getLocationMatchers } from 'app/features/geo/utils/location';
|
||||||
import { ScaleDimensionConfig } from '@grafana/schema';
|
|
||||||
|
|
||||||
// Configuration options for Heatmap overlays
|
// Configuration options for Heatmap overlays
|
||||||
export interface HeatmapConfig {
|
export interface HeatmapConfig {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { markersLayer } from './markersLayer';
|
import { dayNightLayer } from './dayNightLayer';
|
||||||
|
import { dynamicGeoJSONLayer } from './geojsonDynamic';
|
||||||
import { geojsonLayer } from './geojsonLayer';
|
import { geojsonLayer } from './geojsonLayer';
|
||||||
import { heatmapLayer } from './heatMap';
|
import { heatmapLayer } from './heatMap';
|
||||||
import { lastPointTracker } from './lastPointTracker';
|
import { lastPointTracker } from './lastPointTracker';
|
||||||
import { routeLayer } from './routeLayer';
|
import { markersLayer } from './markersLayer';
|
||||||
import { dayNightLayer } from './dayNightLayer';
|
|
||||||
import { dynamicGeoJSONLayer } from './geojsonDynamic';
|
|
||||||
import { photosLayer } from './photosLayer';
|
import { photosLayer } from './photosLayer';
|
||||||
|
import { routeLayer } from './routeLayer';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry for layer handlers
|
* Registry for layer handlers
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { MapLayerRegistryItem, MapLayerOptions, PanelData, GrafanaTheme2, PluginState, EventBus } from '@grafana/data';
|
|
||||||
import Map from 'ol/Map';
|
|
||||||
import Feature from 'ol/Feature';
|
import Feature from 'ol/Feature';
|
||||||
import * as style from 'ol/style';
|
import Map from 'ol/Map';
|
||||||
import * as source from 'ol/source';
|
|
||||||
import * as layer from 'ol/layer';
|
import * as layer from 'ol/layer';
|
||||||
|
import * as source from 'ol/source';
|
||||||
|
import * as style from 'ol/style';
|
||||||
|
|
||||||
|
import { MapLayerRegistryItem, MapLayerOptions, PanelData, GrafanaTheme2, PluginState, EventBus } from '@grafana/data';
|
||||||
import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location';
|
import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location';
|
||||||
|
|
||||||
export interface LastPointConfig {
|
export interface LastPointConfig {
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
|
import { isNumber } from 'lodash';
|
||||||
|
import { FeatureLike } from 'ol/Feature';
|
||||||
|
import Map from 'ol/Map';
|
||||||
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
|
import { ReplaySubject } from 'rxjs';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MapLayerRegistryItem,
|
MapLayerRegistryItem,
|
||||||
MapLayerOptions,
|
MapLayerOptions,
|
||||||
@ -7,18 +13,14 @@ import {
|
|||||||
FrameGeometrySourceMode,
|
FrameGeometrySourceMode,
|
||||||
EventBus,
|
EventBus,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import Map from 'ol/Map';
|
|
||||||
import { FeatureLike } from 'ol/Feature';
|
|
||||||
import { getLocationMatchers } from 'app/features/geo/utils/location';
|
|
||||||
import { ObservablePropsWrapper } from '../../components/ObservablePropsWrapper';
|
|
||||||
import { MarkersLegend, MarkersLegendProps } from '../../components/MarkersLegend';
|
|
||||||
import { ReplaySubject } from 'rxjs';
|
|
||||||
import { defaultStyleConfig, StyleConfig } from '../../style/types';
|
|
||||||
import { StyleEditor } from '../../editor/StyleEditor';
|
|
||||||
import { getStyleConfigState } from '../../style/utils';
|
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
|
||||||
import { isNumber } from 'lodash';
|
|
||||||
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
||||||
|
import { getLocationMatchers } from 'app/features/geo/utils/location';
|
||||||
|
|
||||||
|
import { MarkersLegend, MarkersLegendProps } from '../../components/MarkersLegend';
|
||||||
|
import { ObservablePropsWrapper } from '../../components/ObservablePropsWrapper';
|
||||||
|
import { StyleEditor } from '../../editor/StyleEditor';
|
||||||
|
import { defaultStyleConfig, StyleConfig } from '../../style/types';
|
||||||
|
import { getStyleConfigState } from '../../style/utils';
|
||||||
import { getStyleDimension} from '../../utils/utils';
|
import { getStyleDimension} from '../../utils/utils';
|
||||||
|
|
||||||
// Configuration options for Circle overlays
|
// Configuration options for Circle overlays
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
import { FeatureLike } from 'ol/Feature';
|
||||||
|
import Map from 'ol/Map';
|
||||||
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
|
import { Stroke, Style } from 'ol/style';
|
||||||
|
import Photo from 'ol-ext/style/Photo';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MapLayerRegistryItem,
|
MapLayerRegistryItem,
|
||||||
PanelData,
|
PanelData,
|
||||||
@ -8,14 +14,9 @@ import {
|
|||||||
Field,
|
Field,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { FrameGeometrySourceMode, MapLayerOptions } from '@grafana/schema';
|
import { FrameGeometrySourceMode, MapLayerOptions } from '@grafana/schema';
|
||||||
import Map from 'ol/Map';
|
|
||||||
import { FeatureLike } from 'ol/Feature';
|
|
||||||
import { getLocationMatchers } from 'app/features/geo/utils/location';
|
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
|
||||||
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
|
||||||
import { Stroke, Style } from 'ol/style';
|
|
||||||
import Photo from 'ol-ext/style/Photo';
|
|
||||||
import { findField } from 'app/features/dimensions';
|
import { findField } from 'app/features/dimensions';
|
||||||
|
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
||||||
|
import { getLocationMatchers } from 'app/features/geo/utils/location';
|
||||||
|
|
||||||
// Configuration options for Circle overlays
|
// Configuration options for Circle overlays
|
||||||
export interface PhotoConfig {
|
export interface PhotoConfig {
|
||||||
@ -93,7 +94,7 @@ export const photosLayer: MapLayerRegistryItem<PhotoConfig> = {
|
|||||||
|
|
||||||
vectorLayer.setStyle((feature: FeatureLike) => {
|
vectorLayer.setStyle((feature: FeatureLike) => {
|
||||||
let src = unknownImage;
|
let src = unknownImage;
|
||||||
let idx: number = Infinity;
|
let idx = Infinity;
|
||||||
if (images.length > 0) {
|
if (images.length > 0) {
|
||||||
idx = feature.get('rowIndex') as number;
|
idx = feature.get('rowIndex') as number;
|
||||||
src = images[idx] ?? unknownImage;
|
src = images[idx] ?? unknownImage;
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
import { isNumber } from 'lodash';
|
||||||
|
import Feature, { FeatureLike } from 'ol/Feature';
|
||||||
|
import Map from 'ol/Map';
|
||||||
|
import { LineString, Point, SimpleGeometry } from 'ol/geom';
|
||||||
|
import { Group as LayerGroup } from 'ol/layer';
|
||||||
|
import VectorLayer from 'ol/layer/Vector';
|
||||||
|
import VectorSource from 'ol/source/Vector';
|
||||||
|
import { Fill, Stroke, Style, Circle } from 'ol/style';
|
||||||
|
import FlowLine from 'ol-ext/style/FlowLine';
|
||||||
|
import { Subscription, throttleTime } from 'rxjs';
|
||||||
|
import tinycolor from 'tinycolor2';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MapLayerRegistryItem,
|
MapLayerRegistryItem,
|
||||||
PanelData,
|
PanelData,
|
||||||
@ -9,28 +21,15 @@ import {
|
|||||||
DataFrame,
|
DataFrame,
|
||||||
TIME_SERIES_TIME_FIELD_NAME,
|
TIME_SERIES_TIME_FIELD_NAME,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
|
|
||||||
import { MapLayerOptions, FrameGeometrySourceMode } from '@grafana/schema';
|
|
||||||
|
|
||||||
import Map from 'ol/Map';
|
|
||||||
import { FeatureLike } from 'ol/Feature';
|
|
||||||
import { Subscription, throttleTime } from 'rxjs';
|
|
||||||
import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location';
|
|
||||||
import { defaultStyleConfig, StyleConfig } from '../../style/types';
|
|
||||||
import { StyleEditor } from '../../editor/StyleEditor';
|
|
||||||
import { getStyleConfigState } from '../../style/utils';
|
|
||||||
import VectorLayer from 'ol/layer/Vector';
|
|
||||||
import { isNumber } from 'lodash';
|
|
||||||
import { routeStyle } from '../../style/markers';
|
|
||||||
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
|
||||||
import { Group as LayerGroup } from 'ol/layer';
|
|
||||||
import VectorSource from 'ol/source/Vector';
|
|
||||||
import { Fill, Stroke, Style, Circle } from 'ol/style';
|
|
||||||
import Feature from 'ol/Feature';
|
|
||||||
import { alpha } from '@grafana/data/src/themes/colorManipulator';
|
import { alpha } from '@grafana/data/src/themes/colorManipulator';
|
||||||
import { LineString, Point, SimpleGeometry } from 'ol/geom';
|
import { MapLayerOptions, FrameGeometrySourceMode } from '@grafana/schema';
|
||||||
import FlowLine from 'ol-ext/style/FlowLine';
|
import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource';
|
||||||
import tinycolor from 'tinycolor2';
|
import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location';
|
||||||
|
|
||||||
|
import { StyleEditor } from '../../editor/StyleEditor';
|
||||||
|
import { routeStyle } from '../../style/markers';
|
||||||
|
import { defaultStyleConfig, StyleConfig } from '../../style/types';
|
||||||
|
import { getStyleConfigState } from '../../style/utils';
|
||||||
import { getStyleDimension, isSegmentVisible } from '../../utils/utils';
|
import { getStyleDimension, isSegmentVisible } from '../../utils/utils';
|
||||||
|
|
||||||
// Configuration options for Circle overlays
|
// Configuration options for Circle overlays
|
||||||
@ -87,7 +86,7 @@ export const routeLayer: MapLayerRegistryItem<RouteConfig> = {
|
|||||||
const location = await getLocationMatchers(options.location);
|
const location = await getLocationMatchers(options.location);
|
||||||
const source = new FrameVectorSource(location);
|
const source = new FrameVectorSource(location);
|
||||||
const vectorLayer = new VectorLayer({ source });
|
const vectorLayer = new VectorLayer({ source });
|
||||||
const hasArrows = config.arrow == 1 || config.arrow == -1;
|
const hasArrows = config.arrow === 1 || config.arrow === -1;
|
||||||
|
|
||||||
if (!style.fields && !hasArrows) {
|
if (!style.fields && !hasArrows) {
|
||||||
// Set a global style
|
// Set a global style
|
||||||
@ -132,7 +131,7 @@ export const routeLayer: MapLayerRegistryItem<RouteConfig> = {
|
|||||||
|
|
||||||
const flowStyle = new FlowLine({
|
const flowStyle = new FlowLine({
|
||||||
visible: true,
|
visible: true,
|
||||||
lineCap: config.arrow == 0 ? 'round' : 'square',
|
lineCap: config.arrow === 0 ? 'round' : 'square',
|
||||||
color: color1,
|
color: color1,
|
||||||
color2: color2,
|
color2: color2,
|
||||||
width: (dims.size && dims.size.get(startIndex)) ?? style.base.size,
|
width: (dims.size && dims.size.get(startIndex)) ?? style.base.size,
|
||||||
|
Loading…
Reference in New Issue
Block a user