mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Schema: create a new schema package for basic models (#38409)
This commit is contained in:
parent
8d126de305
commit
425ec7ca9e
@ -23,6 +23,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@braintree/sanitize-url": "5.0.2",
|
"@braintree/sanitize-url": "5.0.2",
|
||||||
|
"@grafana/schema": "8.1.0-pre",
|
||||||
"@types/d3-interpolate": "^1.3.1",
|
"@types/d3-interpolate": "^1.3.1",
|
||||||
"date-fns": "2.21.3",
|
"date-fns": "2.21.3",
|
||||||
"eventemitter3": "4.0.7",
|
"eventemitter3": "4.0.7",
|
||||||
|
@ -21,7 +21,11 @@ const buildCjsPackage = ({ env }) => {
|
|||||||
globals: {},
|
globals: {},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
external: ['lodash', 'rxjs'], // Use Lodash, rxjs from grafana
|
external: [
|
||||||
|
'lodash',
|
||||||
|
'rxjs',
|
||||||
|
'@grafana/schema', // Load from host
|
||||||
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
json({
|
json({
|
||||||
include: ['../../node_modules/moment-timezone/data/packed/latest.json'],
|
include: ['../../node_modules/moment-timezone/data/packed/latest.json'],
|
||||||
|
@ -20,7 +20,7 @@ const buildCjsPackage = ({ env }) => {
|
|||||||
globals: {},
|
globals: {},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
external: ['lodash', 'react', '@grafana/ui', '@grafana/data', '@grafana/e2e-selectors'], // Use Lodash from grafana
|
external: ['lodash', 'react', '@grafana/ui', '@grafana/data', '@grafana/schema', '@grafana/e2e-selectors'], // Use Lodash from grafana
|
||||||
plugins: [
|
plugins: [
|
||||||
commonjs({
|
commonjs({
|
||||||
include: /node_modules/,
|
include: /node_modules/,
|
||||||
|
13
packages/grafana-schema/.eslintrc
Normal file
13
packages/grafana-schema/.eslintrc
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"no-restricted-imports": ["error", { "patterns": ["@grafana/*"] }]
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["**/*.test.{ts,tsx}"],
|
||||||
|
"rules": {
|
||||||
|
"no-restricted-imports": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
3
packages/grafana-schema/CHANGELOG.md
Normal file
3
packages/grafana-schema/CHANGELOG.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# (2021-10)
|
||||||
|
|
||||||
|
First public release
|
202
packages/grafana-schema/LICENSE_APACHE2
Normal file
202
packages/grafana-schema/LICENSE_APACHE2
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright 2015 Grafana Labs
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
5
packages/grafana-schema/README.md
Normal file
5
packages/grafana-schema/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Grafana Schema Library
|
||||||
|
|
||||||
|
> **@grafana/schema is currently in ALPHA**.
|
||||||
|
|
||||||
|
This package holds the definitions for objects that should be stored in JSON configuration files
|
3
packages/grafana-schema/api-extractor.json
Normal file
3
packages/grafana-schema/api-extractor.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../api-extractor.json"
|
||||||
|
}
|
7
packages/grafana-schema/index.js
Normal file
7
packages/grafana-schema/index.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
module.exports = require('./index.production.js');
|
||||||
|
} else {
|
||||||
|
module.exports = require('./index.development.js');
|
||||||
|
}
|
42
packages/grafana-schema/package.json
Normal file
42
packages/grafana-schema/package.json
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"author": "Grafana Labs",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"name": "@grafana/schema",
|
||||||
|
"version": "8.1.0-pre",
|
||||||
|
"description": "Grafana Schema Library",
|
||||||
|
"keywords": [
|
||||||
|
"typescript"
|
||||||
|
],
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "http://github.com/grafana/grafana.git",
|
||||||
|
"directory": "packages/grafana-schema"
|
||||||
|
},
|
||||||
|
"main": "src/index.ts",
|
||||||
|
"types": "src/index.ts",
|
||||||
|
"scripts": {
|
||||||
|
"build": "grafana-toolkit package:build --scope=schema",
|
||||||
|
"bundle": "rollup -c rollup.config.ts",
|
||||||
|
"clean": "rimraf ./dist ./compiled",
|
||||||
|
"docsExtract": "mkdir -p ../../reports/docs && api-extractor run 2>&1 | tee ../../reports/docs/$(basename $(pwd)).log",
|
||||||
|
"typecheck": "tsc --noEmit"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"@grafana/tsconfig": "^1.0.0-rc1",
|
||||||
|
"@rollup/plugin-commonjs": "16.0.0",
|
||||||
|
"@rollup/plugin-json": "4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "10.0.0",
|
||||||
|
"@types/rollup-plugin-visualizer": "2.6.0",
|
||||||
|
"pretty-format": "25.1.0",
|
||||||
|
"rollup": "2.33.3",
|
||||||
|
"rollup-plugin-sourcemaps": "0.6.3",
|
||||||
|
"rollup-plugin-terser": "7.0.2",
|
||||||
|
"rollup-plugin-typescript2": "0.29.0",
|
||||||
|
"rollup-plugin-visualizer": "4.2.0",
|
||||||
|
"typescript": "4.3.4"
|
||||||
|
},
|
||||||
|
"volta": {
|
||||||
|
"extends": "../../package.json"
|
||||||
|
}
|
||||||
|
}
|
33
packages/grafana-schema/rollup.config.ts
Normal file
33
packages/grafana-schema/rollup.config.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import resolve from '@rollup/plugin-node-resolve';
|
||||||
|
import commonjs from '@rollup/plugin-commonjs';
|
||||||
|
import sourceMaps from 'rollup-plugin-sourcemaps';
|
||||||
|
import { terser } from 'rollup-plugin-terser';
|
||||||
|
|
||||||
|
const pkg = require('./package.json');
|
||||||
|
|
||||||
|
const libraryName = pkg.name;
|
||||||
|
|
||||||
|
const buildCjsPackage = ({ env }) => {
|
||||||
|
return {
|
||||||
|
input: `compiled/index.js`,
|
||||||
|
output: [
|
||||||
|
{
|
||||||
|
file: `dist/index.${env}.js`,
|
||||||
|
name: libraryName,
|
||||||
|
format: 'cjs',
|
||||||
|
sourcemap: true,
|
||||||
|
exports: 'named',
|
||||||
|
globals: {},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
commonjs({
|
||||||
|
include: /node_modules/,
|
||||||
|
}),
|
||||||
|
resolve(),
|
||||||
|
sourceMaps(),
|
||||||
|
env === 'production' && terser(),
|
||||||
|
],
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|
8
packages/grafana-schema/src/index.ts
Normal file
8
packages/grafana-schema/src/index.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* A library containing most of the static shapes required by Grafana.
|
||||||
|
*
|
||||||
|
* @packageDocumentation
|
||||||
|
*/
|
||||||
|
export * from './schema/legend.gen';
|
||||||
|
export * from './schema/tooltip.gen';
|
||||||
|
export * from './schema/text.gen';
|
13
packages/grafana-schema/src/schema/legend.cue
Normal file
13
packages/grafana-schema/src/schema/legend.cue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
LegendPlacement: "bottom" | "right" @cuetsy(targetType="type")
|
||||||
|
|
||||||
|
LegendDisplayMode: "list" | "table" | "hidden" @cuetsy(targetType="enum")
|
||||||
|
|
||||||
|
VizLegendOptions: {
|
||||||
|
displayMode: LegendDisplayMode
|
||||||
|
placement: LegendPlacement
|
||||||
|
asTable: bool | *false
|
||||||
|
isVisible: bool | *false
|
||||||
|
calcs: [...string]
|
||||||
|
} @cuetsy(targetType="interface")
|
@ -3,14 +3,32 @@
|
|||||||
// It is currenty hand written but will serve as the target for cuetsy
|
// It is currenty hand written but will serve as the target for cuetsy
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export type LegendPlacement = 'bottom' | 'right';
|
export type LegendPlacement = 'bottom' | 'right';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export enum LegendDisplayMode {
|
export enum LegendDisplayMode {
|
||||||
Hidden = 'hidden',
|
Hidden = 'hidden',
|
||||||
List = 'list',
|
List = 'list',
|
||||||
Table = 'table',
|
Table = 'table',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export interface VizLegendOptions {
|
export interface VizLegendOptions {
|
||||||
calcs: string[];
|
calcs: string[];
|
||||||
displayMode: LegendDisplayMode;
|
displayMode: LegendDisplayMode;
|
||||||
placement: LegendPlacement;
|
placement: LegendPlacement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export interface OptionsWithLegend {
|
||||||
|
legend: VizLegendOptions;
|
||||||
|
}
|
7
packages/grafana-schema/src/schema/text.cue
Normal file
7
packages/grafana-schema/src/schema/text.cue
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
VizTextDisplayOptions: {
|
||||||
|
// Explicit title text size
|
||||||
|
titleSize?: number
|
||||||
|
// Explicit value text size
|
||||||
|
valueSize?: number
|
||||||
|
} @cuetsy(targetType="interface")
|
@ -1,5 +1,7 @@
|
|||||||
// TODO: this should be generated with cue
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
import { VizLegendOptions, VizTooltipOptions } from '../components';
|
// NOTE: This file will be auto generated from models.cue
|
||||||
|
// It is currenty hand written but will serve as the target for cuetsy
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Explicit control for visualization text settings
|
* Explicit control for visualization text settings
|
||||||
@ -12,20 +14,6 @@ export interface VizTextDisplayOptions {
|
|||||||
valueSize?: number;
|
valueSize?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @public
|
|
||||||
*/
|
|
||||||
export interface OptionsWithLegend {
|
|
||||||
legend: VizLegendOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @public
|
|
||||||
*/
|
|
||||||
export interface OptionsWithTooltip {
|
|
||||||
tooltip: VizTooltipOptions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @public
|
* @public
|
||||||
*/
|
*/
|
5
packages/grafana-schema/src/schema/tooltip.cue
Normal file
5
packages/grafana-schema/src/schema/tooltip.cue
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
TooltipDisplayMode: "single" | "multi" | "none" @cuetsy(targetType="enum")
|
||||||
|
|
||||||
|
VizTooltipOptions: {
|
||||||
|
mode: TooltipDisplayMode
|
||||||
|
} @cuetsy(targetType="interface")
|
@ -18,3 +18,10 @@ export enum TooltipDisplayMode {
|
|||||||
export type VizTooltipOptions = {
|
export type VizTooltipOptions = {
|
||||||
mode: TooltipDisplayMode;
|
mode: TooltipDisplayMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
export interface OptionsWithTooltip {
|
||||||
|
tooltip: VizTooltipOptions;
|
||||||
|
}
|
4
packages/grafana-schema/tsconfig.build.json
Normal file
4
packages/grafana-schema/tsconfig.build.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"exclude": ["dist", "node_modules", "**/*.test.ts*"],
|
||||||
|
"extends": "./tsconfig.json"
|
||||||
|
}
|
10
packages/grafana-schema/tsconfig.json
Normal file
10
packages/grafana-schema/tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"declarationDir": "dist",
|
||||||
|
"outDir": "compiled",
|
||||||
|
"rootDirs": ["."]
|
||||||
|
},
|
||||||
|
"exclude": ["dist", "node_modules"],
|
||||||
|
"extends": "@grafana/tsconfig",
|
||||||
|
"include": ["src/**/*.ts*"]
|
||||||
|
}
|
@ -29,6 +29,7 @@
|
|||||||
"@emotion/css": "11.1.3",
|
"@emotion/css": "11.1.3",
|
||||||
"@emotion/react": "11.1.5",
|
"@emotion/react": "11.1.5",
|
||||||
"@grafana/aws-sdk": "0.0.3",
|
"@grafana/aws-sdk": "0.0.3",
|
||||||
|
"@grafana/schema": "8.1.0-pre",
|
||||||
"@grafana/data": "8.1.0-pre",
|
"@grafana/data": "8.1.0-pre",
|
||||||
"@grafana/e2e-selectors": "8.1.0-pre",
|
"@grafana/e2e-selectors": "8.1.0-pre",
|
||||||
"@grafana/slate-react": "0.22.10-grafana",
|
"@grafana/slate-react": "0.22.10-grafana",
|
||||||
|
@ -30,6 +30,7 @@ const buildCjsPackage = ({ env }) => {
|
|||||||
'react-dom',
|
'react-dom',
|
||||||
'@grafana/aws-sdk',
|
'@grafana/aws-sdk',
|
||||||
'@grafana/data',
|
'@grafana/data',
|
||||||
|
'@grafana/schema',
|
||||||
'@grafana/e2e-selectors',
|
'@grafana/e2e-selectors',
|
||||||
'moment',
|
'moment',
|
||||||
'jquery', // required to use jquery.plot, which is assigned externally
|
'jquery', // required to use jquery.plot, which is assigned externally
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
import { dateTime, ArrayVector, FieldType, GraphSeriesXY, FieldColorModeId, getDisplayProcessor } from '@grafana/data';
|
import { dateTime, ArrayVector, FieldType, GraphSeriesXY, FieldColorModeId, getDisplayProcessor } from '@grafana/data';
|
||||||
import { Story } from '@storybook/react';
|
import { Story } from '@storybook/react';
|
||||||
import { useTheme2 } from '../../themes';
|
import { useTheme2 } from '../../themes';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { VizTooltip, TooltipDisplayMode, VizTooltipContentProps } from '../VizTooltip';
|
import { VizTooltip, VizTooltipContentProps } from '../VizTooltip';
|
||||||
import { JSONFormatter } from '../JSONFormatter/JSONFormatter';
|
import { JSONFormatter } from '../JSONFormatter/JSONFormatter';
|
||||||
import { GraphProps, Graph } from './Graph';
|
import { GraphProps, Graph } from './Graph';
|
||||||
|
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import Graph from './Graph';
|
import Graph from './Graph';
|
||||||
import { VizTooltip, TooltipDisplayMode } from '../VizTooltip';
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
|
import { VizTooltip } from '../VizTooltip';
|
||||||
import { GraphSeriesXY, FieldType, ArrayVector, dateTime, FieldColorModeId, DisplayProcessor } from '@grafana/data';
|
import { GraphSeriesXY, FieldType, ArrayVector, dateTime, FieldColorModeId, DisplayProcessor } from '@grafana/data';
|
||||||
|
|
||||||
const display: DisplayProcessor = (v) => ({ numeric: v, text: String(v), color: 'red' });
|
const display: DisplayProcessor = (v) => ({ numeric: v, text: String(v), color: 'red' });
|
||||||
|
@ -3,6 +3,7 @@ import $ from 'jquery';
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import { uniqBy } from 'lodash';
|
import { uniqBy } from 'lodash';
|
||||||
// Types
|
// Types
|
||||||
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
import { TimeRange, GraphSeriesXY, TimeZone, createDimension } from '@grafana/data';
|
import { TimeRange, GraphSeriesXY, TimeZone, createDimension } from '@grafana/data';
|
||||||
import { FlotPosition, FlotItem } from './types';
|
import { FlotPosition, FlotItem } from './types';
|
||||||
import { VizTooltipProps, VizTooltipContentProps, ActiveDimensions, VizTooltip } from '../VizTooltip';
|
import { VizTooltipProps, VizTooltipContentProps, ActiveDimensions, VizTooltip } from '../VizTooltip';
|
||||||
@ -10,7 +11,6 @@ import { GraphTooltip } from './GraphTooltip/GraphTooltip';
|
|||||||
import { GraphContextMenu, GraphContextMenuProps, ContextDimensions } from './GraphContextMenu';
|
import { GraphContextMenu, GraphContextMenuProps, ContextDimensions } from './GraphContextMenu';
|
||||||
import { GraphDimensions } from './GraphTooltip/types';
|
import { GraphDimensions } from './GraphTooltip/types';
|
||||||
import { graphTimeFormat, graphTickFormatter } from './utils';
|
import { graphTimeFormat, graphTickFormatter } from './utils';
|
||||||
import { TooltipDisplayMode } from '../VizTooltip/models.gen';
|
|
||||||
|
|
||||||
export interface GraphProps {
|
export interface GraphProps {
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
|
@ -3,7 +3,7 @@ import React from 'react';
|
|||||||
import { Story } from '@storybook/react';
|
import { Story } from '@storybook/react';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { GraphWithLegend, GraphWithLegendProps } from './GraphWithLegend';
|
import { GraphWithLegend, GraphWithLegendProps } from './GraphWithLegend';
|
||||||
import { LegendDisplayMode } from '../VizLegend/models.gen';
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import { GraphSeriesXY, FieldType, ArrayVector, dateTime, FieldColorModeId } from '@grafana/data';
|
import { GraphSeriesXY, FieldType, ArrayVector, dateTime, FieldColorModeId } from '@grafana/data';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -6,7 +6,7 @@ import { GraphSeriesValue } from '@grafana/data';
|
|||||||
|
|
||||||
import { Graph, GraphProps } from './Graph';
|
import { Graph, GraphProps } from './Graph';
|
||||||
import { VizLegendItem } from '../VizLegend/types';
|
import { VizLegendItem } from '../VizLegend/types';
|
||||||
import { LegendDisplayMode, LegendPlacement } from '../VizLegend/models.gen';
|
import { LegendDisplayMode, LegendPlacement } from '@grafana/schema';
|
||||||
import { VizLegend } from '../VizLegend/VizLegend';
|
import { VizLegend } from '../VizLegend/VizLegend';
|
||||||
import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar';
|
import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar';
|
||||||
import { stylesFactory } from '../../themes';
|
import { stylesFactory } from '../../themes';
|
||||||
|
@ -2,7 +2,7 @@ import { FieldColorModeId, toDataFrame, dateTime } from '@grafana/data';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { GraphNGProps } from './GraphNG';
|
import { GraphNGProps } from './GraphNG';
|
||||||
import { LegendDisplayMode, LegendPlacement } from '../VizLegend/models.gen';
|
import { LegendDisplayMode, LegendPlacement } from '@grafana/schema';
|
||||||
import { prepDataForStorybook } from '../../utils/storybook/data';
|
import { prepDataForStorybook } from '../../utils/storybook/data';
|
||||||
import { useTheme2 } from '../../themes';
|
import { useTheme2 } from '../../themes';
|
||||||
import { Story } from '@storybook/react';
|
import { Story } from '@storybook/react';
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { preparePlotFrame as defaultPreparePlotFrame } from './utils';
|
import { preparePlotFrame as defaultPreparePlotFrame } from './utils';
|
||||||
|
|
||||||
import { VizLegendOptions } from '../VizLegend/models.gen';
|
import { VizLegendOptions } from '@grafana/schema';
|
||||||
import { PanelContext, PanelContextRoot } from '../PanelChrome/PanelContext';
|
import { PanelContext, PanelContextRoot } from '../PanelChrome/PanelContext';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { throttleTime } from 'rxjs/operators';
|
import { throttleTime } from 'rxjs/operators';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { cloneDeep, isNumber, omit } from 'lodash';
|
import { cloneDeep, isNumber, omit } from 'lodash';
|
||||||
|
|
||||||
|
import { OptionsWithTextFormatting } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
convertOldAngularValueMappings,
|
convertOldAngularValueMappings,
|
||||||
FieldColorModeId,
|
FieldColorModeId,
|
||||||
@ -16,7 +17,6 @@ import {
|
|||||||
ValueMapping,
|
ValueMapping,
|
||||||
VizOrientation,
|
VizOrientation,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { OptionsWithTextFormatting } from '../../options';
|
|
||||||
|
|
||||||
export interface SingleStatBaseOptions extends OptionsWithTextFormatting {
|
export interface SingleStatBaseOptions extends OptionsWithTextFormatting {
|
||||||
reduceOptions: ReduceDataOptions;
|
reduceOptions: ReduceDataOptions;
|
||||||
|
@ -3,7 +3,7 @@ import { DataFrame, TimeRange } from '@grafana/data';
|
|||||||
import { GraphNG, GraphNGProps } from '../GraphNG/GraphNG';
|
import { GraphNG, GraphNGProps } from '../GraphNG/GraphNG';
|
||||||
import { UPlotConfigBuilder } from '../uPlot/config/UPlotConfigBuilder';
|
import { UPlotConfigBuilder } from '../uPlot/config/UPlotConfigBuilder';
|
||||||
import { PlotLegend } from '../uPlot/PlotLegend';
|
import { PlotLegend } from '../uPlot/PlotLegend';
|
||||||
import { LegendDisplayMode } from '../VizLegend/models.gen';
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import { preparePlotConfigBuilder } from './utils';
|
import { preparePlotConfigBuilder } from './utils';
|
||||||
import { withTheme2 } from '../../themes/ThemeContext';
|
import { withTheme2 } from '../../themes/ThemeContext';
|
||||||
import { PanelContext, PanelContextRoot } from '../PanelChrome/PanelContext';
|
import { PanelContext, PanelContextRoot } from '../PanelChrome/PanelContext';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { FC, CSSProperties, ComponentType } from 'react';
|
import React, { FC, CSSProperties, ComponentType } from 'react';
|
||||||
import { useMeasure } from 'react-use';
|
import { useMeasure } from 'react-use';
|
||||||
import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar';
|
import { CustomScrollbar } from '../CustomScrollbar/CustomScrollbar';
|
||||||
import { LegendPlacement } from '..';
|
import { LegendPlacement } from '@grafana/schema';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @beta
|
* @beta
|
||||||
|
@ -5,7 +5,7 @@ import {} from './VizLegendListItem';
|
|||||||
import { DisplayValue, getColorForTheme, GrafanaTheme } from '@grafana/data';
|
import { DisplayValue, getColorForTheme, GrafanaTheme } from '@grafana/data';
|
||||||
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
|
||||||
import { VizLegendItem } from './types';
|
import { VizLegendItem } from './types';
|
||||||
import { LegendDisplayMode, LegendPlacement } from './models.gen';
|
import { LegendDisplayMode, LegendPlacement } from '@grafana/schema';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Visualizations/VizLegend',
|
title: 'Visualizations/VizLegend',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useCallback } from 'react';
|
import React, { useCallback } from 'react';
|
||||||
import { LegendProps, SeriesVisibilityChangeBehavior, VizLegendItem } from './types';
|
import { LegendProps, SeriesVisibilityChangeBehavior, VizLegendItem } from './types';
|
||||||
import { LegendDisplayMode } from './models.gen';
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import { VizLegendTable } from './VizLegendTable';
|
import { VizLegendTable } from './VizLegendTable';
|
||||||
import { VizLegendList } from './VizLegendList';
|
import { VizLegendList } from './VizLegendList';
|
||||||
import { DataHoverClearEvent, DataHoverEvent } from '@grafana/data';
|
import { DataHoverClearEvent, DataHoverEvent } from '@grafana/data';
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
package grafanaschema
|
|
||||||
|
|
||||||
LegendPlacement: "bottom" | "right" @cuetsy(targetType="type")
|
|
||||||
LegendDisplayMode: "list" | "table" | "hidden" @cuetsy(targetType="enum")
|
|
||||||
|
|
||||||
VizLegendOptions: {
|
|
||||||
displayMode: LegendDisplayMode
|
|
||||||
placement: LegendPlacement
|
|
||||||
asTable: bool | *false
|
|
||||||
isVisible: bool | *false
|
|
||||||
calcs: [...string]
|
|
||||||
|
|
||||||
} @cuetsy(targetType="interface")
|
|
||||||
|
|
||||||
// TODO this excludes all the types that include function definitions
|
|
@ -1,6 +1,7 @@
|
|||||||
import { DataFrameFieldIndex, DisplayValue } from '@grafana/data';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { LegendDisplayMode, LegendPlacement } from './models.gen';
|
|
||||||
|
import { DataFrameFieldIndex, DisplayValue } from '@grafana/data';
|
||||||
|
import { LegendDisplayMode, LegendPlacement } from '@grafana/schema';
|
||||||
|
|
||||||
export enum SeriesVisibilityChangeBehavior {
|
export enum SeriesVisibilityChangeBehavior {
|
||||||
Isolate,
|
Isolate,
|
||||||
|
@ -5,7 +5,7 @@ import { Dimensions, TimeZone } from '@grafana/data';
|
|||||||
import { FlotPosition } from '../Graph/types';
|
import { FlotPosition } from '../Graph/types';
|
||||||
import { VizTooltipContainer } from './VizTooltipContainer';
|
import { VizTooltipContainer } from './VizTooltipContainer';
|
||||||
import { useStyles } from '../../themes';
|
import { useStyles } from '../../themes';
|
||||||
import { TooltipDisplayMode } from './models.gen';
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
|
|
||||||
// Describes active dimensions user interacts with
|
// Describes active dimensions user interacts with
|
||||||
// It's a key-value pair where:
|
// It's a key-value pair where:
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
export { VizTooltip, VizTooltipContentProps, VizTooltipProps, ActiveDimensions } from './VizTooltip';
|
export { VizTooltip, VizTooltipContentProps, VizTooltipProps, ActiveDimensions } from './VizTooltip';
|
||||||
export { VizTooltipContainer, VizTooltipContainerProps } from './VizTooltipContainer';
|
export { VizTooltipContainer, VizTooltipContainerProps } from './VizTooltipContainer';
|
||||||
export { SeriesTable, SeriesTableRow, SeriesTableProps, SeriesTableRowProps } from './SeriesTable';
|
export { SeriesTable, SeriesTableRow, SeriesTableProps, SeriesTableRowProps } from './SeriesTable';
|
||||||
export { TooltipDisplayMode, VizTooltipOptions } from './models.gen';
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
package grafanaschema
|
|
||||||
|
|
||||||
TooltipDisplayMode: "single" | "multi" | "none" @cuetsy(targetType="enum")
|
|
||||||
|
|
||||||
VizTooltipOptions: {
|
|
||||||
mode: TooltipDisplayMode
|
|
||||||
} @cuetsy(targetType="interface")
|
|
@ -81,8 +81,6 @@ export {
|
|||||||
VizTooltip,
|
VizTooltip,
|
||||||
VizTooltipContainer,
|
VizTooltipContainer,
|
||||||
SeriesTable,
|
SeriesTable,
|
||||||
VizTooltipOptions,
|
|
||||||
TooltipDisplayMode,
|
|
||||||
SeriesTableProps,
|
SeriesTableProps,
|
||||||
SeriesTableRow,
|
SeriesTableRow,
|
||||||
SeriesTableRowProps,
|
SeriesTableRowProps,
|
||||||
@ -105,7 +103,6 @@ export {
|
|||||||
} from './PanelChrome';
|
} from './PanelChrome';
|
||||||
export { VizLayout, VizLayoutComponentType, VizLayoutLegendProps, VizLayoutProps } from './VizLayout/VizLayout';
|
export { VizLayout, VizLayoutComponentType, VizLayoutLegendProps, VizLayoutProps } from './VizLayout/VizLayout';
|
||||||
export { VizLegendItem, SeriesVisibilityChangeBehavior } from './VizLegend/types';
|
export { VizLegendItem, SeriesVisibilityChangeBehavior } from './VizLegend/types';
|
||||||
export { LegendPlacement, LegendDisplayMode, VizLegendOptions } from './VizLegend/models.gen';
|
|
||||||
export { VizLegend } from './VizLegend/VizLegend';
|
export { VizLegend } from './VizLegend/VizLegend';
|
||||||
export { VizLegendListItem } from './VizLegend/VizLegendListItem';
|
export { VizLegendListItem } from './VizLegend/VizLegendListItem';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { UPlotConfigBuilder } from './config/UPlotConfigBuilder';
|
import { UPlotConfigBuilder } from './config/UPlotConfigBuilder';
|
||||||
import { VizLegendItem } from '../VizLegend/types';
|
import { VizLegendItem } from '../VizLegend/types';
|
||||||
import { VizLegendOptions } from '../VizLegend/models.gen';
|
import { VizLegendOptions } from '@grafana/schema';
|
||||||
import { AxisPlacement } from './config';
|
import { AxisPlacement } from './config';
|
||||||
import { VizLayout, VizLayoutLegendProps } from '../VizLayout/VizLayout';
|
import { VizLayout, VizLayoutLegendProps } from '../VizLayout/VizLayout';
|
||||||
import { VizLegend } from '../VizLegend/VizLegend';
|
import { VizLegend } from '../VizLegend/VizLegend';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect, useLayoutEffect, useState } from 'react';
|
import React, { useEffect, useLayoutEffect, useState } from 'react';
|
||||||
import { Portal } from '../../Portal/Portal';
|
import { Portal } from '../../Portal/Portal';
|
||||||
import { usePlotContext } from '../context';
|
import { usePlotContext } from '../context';
|
||||||
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
CartesianCoords2D,
|
CartesianCoords2D,
|
||||||
DashboardCursorSync,
|
DashboardCursorSync,
|
||||||
@ -12,7 +13,7 @@ import {
|
|||||||
getFieldDisplayName,
|
getFieldDisplayName,
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { SeriesTable, SeriesTableRowProps, TooltipDisplayMode, VizTooltipContainer } from '../../VizTooltip';
|
import { SeriesTable, SeriesTableRowProps, VizTooltipContainer } from '../../VizTooltip';
|
||||||
import { UPlotConfigBuilder } from '../config/UPlotConfigBuilder';
|
import { UPlotConfigBuilder } from '../config/UPlotConfigBuilder';
|
||||||
import { findMidPointYPosition, pluginLog } from '../utils';
|
import { findMidPointYPosition, pluginLog } from '../utils';
|
||||||
import { useTheme2 } from '../../../themes/ThemeContext';
|
import { useTheme2 } from '../../../themes/ThemeContext';
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { PanelOptionsEditorBuilder, standardEditorsRegistry, StatsPickerConfigSettings } from '@grafana/data';
|
import { PanelOptionsEditorBuilder, standardEditorsRegistry, StatsPickerConfigSettings } from '@grafana/data';
|
||||||
import { LegendDisplayMode } from '../../index';
|
import { LegendDisplayMode, OptionsWithLegend } from '@grafana/schema';
|
||||||
import { OptionsWithLegend } from '../models.gen';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @alpha
|
* @alpha
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { OptionsWithTextFormatting } from '../models.gen';
|
import { OptionsWithTextFormatting } from '@grafana/schema';
|
||||||
import { PanelOptionsEditorBuilder } from '@grafana/data';
|
import { PanelOptionsEditorBuilder } from '@grafana/data';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { OptionsWithTooltip } from '../models.gen';
|
import { OptionsWithTooltip } from '@grafana/schema';
|
||||||
import { PanelOptionsEditorBuilder } from '@grafana/data';
|
import { PanelOptionsEditorBuilder } from '@grafana/data';
|
||||||
|
|
||||||
export function addTooltipOptions<T extends OptionsWithTooltip>(
|
export function addTooltipOptions<T extends OptionsWithTooltip>(
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// namespace is too big
|
// namespace is too big
|
||||||
import * as commonOptionsBuilder from './builder';
|
import * as commonOptionsBuilder from './builder';
|
||||||
export { commonOptionsBuilder };
|
export { commonOptionsBuilder };
|
||||||
|
|
||||||
export * from './models.gen';
|
|
||||||
|
@ -12,5 +12,5 @@
|
|||||||
},
|
},
|
||||||
"exclude": ["dist", "node_modules"],
|
"exclude": ["dist", "node_modules"],
|
||||||
"extends": "@grafana/tsconfig",
|
"extends": "@grafana/tsconfig",
|
||||||
"include": ["src/**/*.ts*", "../../public/app/types/*.d.ts"]
|
"include": ["src/**/*.ts*", "../../public/app/types/*.d.ts", "../grafana-schema/src/schema/models.gen.ts"]
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@ import { connect, ConnectedProps } from 'react-redux';
|
|||||||
import AutoSizer from 'react-virtualized-auto-sizer';
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
||||||
import memoizeOne from 'memoize-one';
|
import memoizeOne from 'memoize-one';
|
||||||
import { selectors } from '@grafana/e2e-selectors';
|
import { selectors } from '@grafana/e2e-selectors';
|
||||||
import { ErrorBoundaryAlert, CustomScrollbar, Collapse, TooltipDisplayMode, withTheme2, Themeable2 } from '@grafana/ui';
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
|
import { ErrorBoundaryAlert, CustomScrollbar, Collapse, withTheme2, Themeable2 } from '@grafana/ui';
|
||||||
import { AbsoluteTimeRange, DataQuery, LoadingState, RawTimeRange, DataFrame, GrafanaTheme2 } from '@grafana/data';
|
import { AbsoluteTimeRange, DataQuery, LoadingState, RawTimeRange, DataFrame, GrafanaTheme2 } from '@grafana/data';
|
||||||
|
|
||||||
import LogsContainer from './LogsContainer';
|
import LogsContainer from './LogsContainer';
|
||||||
|
@ -16,17 +16,16 @@ import {
|
|||||||
import {
|
import {
|
||||||
DrawStyle,
|
DrawStyle,
|
||||||
Icon,
|
Icon,
|
||||||
LegendDisplayMode,
|
|
||||||
PanelContext,
|
PanelContext,
|
||||||
PanelContextProvider,
|
PanelContextProvider,
|
||||||
SeriesVisibilityChangeMode,
|
SeriesVisibilityChangeMode,
|
||||||
TimeSeries,
|
TimeSeries,
|
||||||
TooltipDisplayMode,
|
|
||||||
TooltipPlugin,
|
TooltipPlugin,
|
||||||
useStyles2,
|
useStyles2,
|
||||||
useTheme2,
|
useTheme2,
|
||||||
ZoomPlugin,
|
ZoomPlugin,
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
|
import { LegendDisplayMode, TooltipDisplayMode } from '@grafana/schema';
|
||||||
import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config';
|
import { defaultGraphConfig, getGraphFieldConfig } from 'app/plugins/panel/timeseries/config';
|
||||||
import { ContextMenuPlugin } from 'app/plugins/panel/timeseries/plugins/ContextMenuPlugin';
|
import { ContextMenuPlugin } from 'app/plugins/panel/timeseries/plugins/ContextMenuPlugin';
|
||||||
import { ExemplarsPlugin } from 'app/plugins/panel/timeseries/plugins/ExemplarsPlugin';
|
import { ExemplarsPlugin } from 'app/plugins/panel/timeseries/plugins/ExemplarsPlugin';
|
||||||
|
@ -2,7 +2,7 @@ import React, { PureComponent, createRef } from 'react';
|
|||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
import { capitalize } from 'lodash';
|
import { capitalize } from 'lodash';
|
||||||
import memoizeOne from 'memoize-one';
|
import memoizeOne from 'memoize-one';
|
||||||
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
rangeUtil,
|
rangeUtil,
|
||||||
RawTimeRange,
|
RawTimeRange,
|
||||||
@ -28,7 +28,6 @@ import {
|
|||||||
InlineFieldRow,
|
InlineFieldRow,
|
||||||
InlineSwitch,
|
InlineSwitch,
|
||||||
withTheme2,
|
withTheme2,
|
||||||
TooltipDisplayMode,
|
|
||||||
Themeable2,
|
Themeable2,
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
import store from 'app/core/store';
|
import store from 'app/core/store';
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { VizTooltipOptions, TooltipDisplayMode, LegendDisplayMode, LegendPlacement } from '@grafana/ui';
|
import { VizTooltipOptions, TooltipDisplayMode, LegendDisplayMode, LegendPlacement } from '@grafana/schema';
|
||||||
import { YAxis } from '@grafana/data';
|
import { YAxis } from '@grafana/data';
|
||||||
|
|
||||||
export interface SeriesOptions {
|
export interface SeriesOptions {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
ApplyFieldOverrideOptions,
|
ApplyFieldOverrideOptions,
|
||||||
DataTransformerConfig,
|
DataTransformerConfig,
|
||||||
@ -6,7 +7,7 @@ import {
|
|||||||
NavModelItem,
|
NavModelItem,
|
||||||
PanelData,
|
PanelData,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { LegendDisplayMode, Table, TimeSeries } from '@grafana/ui';
|
import { Table, TimeSeries } from '@grafana/ui';
|
||||||
import { config } from 'app/core/config';
|
import { config } from 'app/core/config';
|
||||||
import React, { FC, useMemo, useState } from 'react';
|
import React, { FC, useMemo, useState } from 'react';
|
||||||
import { useObservable } from 'react-use';
|
import { useObservable } from 'react-use';
|
||||||
|
@ -1,15 +1,8 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
import { DataFrame, TimeRange } from '@grafana/data';
|
import { DataFrame, TimeRange } from '@grafana/data';
|
||||||
import {
|
import { GraphNG, GraphNGProps, PlotLegend, UPlotConfigBuilder, usePanelContext, useTheme2 } from '@grafana/ui';
|
||||||
GraphNG,
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
GraphNGProps,
|
|
||||||
LegendDisplayMode,
|
|
||||||
PlotLegend,
|
|
||||||
UPlotConfigBuilder,
|
|
||||||
usePanelContext,
|
|
||||||
useTheme2,
|
|
||||||
} from '@grafana/ui';
|
|
||||||
import { BarChartOptions } from './types';
|
import { BarChartOptions } from './types';
|
||||||
import { preparePlotConfigBuilder, preparePlotFrame } from './utils';
|
import { preparePlotConfigBuilder, preparePlotFrame } from './utils';
|
||||||
import { PropDiffFn } from '../../../../../packages/grafana-ui/src/components/GraphNG/GraphNG';
|
import { PropDiffFn } from '../../../../../packages/grafana-ui/src/components/GraphNG/GraphNG';
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
import { PanelProps, TimeRange, VizOrientation } from '@grafana/data';
|
import { PanelProps, TimeRange, VizOrientation } from '@grafana/data';
|
||||||
import { StackingMode, TooltipDisplayMode, TooltipPlugin, useTheme2 } from '@grafana/ui';
|
import { StackingMode, TooltipPlugin, useTheme2 } from '@grafana/ui';
|
||||||
import { BarChartOptions } from './types';
|
import { BarChartOptions } from './types';
|
||||||
import { BarChart } from './BarChart';
|
import { BarChart } from './BarChart';
|
||||||
import { prepareGraphableFrames } from './utils';
|
import { prepareGraphableFrames } from './utils';
|
||||||
|
@ -2,10 +2,10 @@ import uPlot, { Axis, AlignedData } from 'uplot';
|
|||||||
import { pointWithin, Quadtree, Rect } from './quadtree';
|
import { pointWithin, Quadtree, Rect } from './quadtree';
|
||||||
import { distribute, SPACE_BETWEEN } from './distribute';
|
import { distribute, SPACE_BETWEEN } from './distribute';
|
||||||
import { DataFrame, GrafanaTheme2 } from '@grafana/data';
|
import { DataFrame, GrafanaTheme2 } from '@grafana/data';
|
||||||
|
import { VizTextDisplayOptions } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
calculateFontSize,
|
calculateFontSize,
|
||||||
PlotTooltipInterpolator,
|
PlotTooltipInterpolator,
|
||||||
VizTextDisplayOptions,
|
|
||||||
StackingMode,
|
StackingMode,
|
||||||
BarValueVisibility,
|
BarValueVisibility,
|
||||||
ScaleDirection,
|
ScaleDirection,
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
|
import { OptionsWithLegend, OptionsWithTextFormatting, OptionsWithTooltip } from '@grafana/schema';
|
||||||
import { VizOrientation } from '@grafana/data';
|
import { VizOrientation } from '@grafana/data';
|
||||||
import {
|
import { AxisConfig, BarValueVisibility, GraphGradientMode, HideableFieldConfig, StackingMode } from '@grafana/ui';
|
||||||
AxisConfig,
|
|
||||||
BarValueVisibility,
|
|
||||||
GraphGradientMode,
|
|
||||||
HideableFieldConfig,
|
|
||||||
OptionsWithLegend,
|
|
||||||
OptionsWithTextFormatting,
|
|
||||||
OptionsWithTooltip,
|
|
||||||
StackingMode,
|
|
||||||
} from '@grafana/ui';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @alpha
|
* @alpha
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { prepareGraphableFrames, preparePlotConfigBuilder, preparePlotFrame } from './utils';
|
import { prepareGraphableFrames, preparePlotConfigBuilder, preparePlotFrame } from './utils';
|
||||||
|
import { LegendDisplayMode, TooltipDisplayMode } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
createTheme,
|
createTheme,
|
||||||
DefaultTimeZone,
|
DefaultTimeZone,
|
||||||
@ -10,13 +11,7 @@ import {
|
|||||||
VizOrientation,
|
VizOrientation,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import { BarChartFieldConfig, BarChartOptions } from './types';
|
import { BarChartFieldConfig, BarChartOptions } from './types';
|
||||||
import {
|
import { BarValueVisibility, GraphGradientMode, StackingMode } from '@grafana/ui';
|
||||||
BarValueVisibility,
|
|
||||||
GraphGradientMode,
|
|
||||||
LegendDisplayMode,
|
|
||||||
StackingMode,
|
|
||||||
TooltipDisplayMode,
|
|
||||||
} from '@grafana/ui';
|
|
||||||
|
|
||||||
function mockDataFrame() {
|
function mockDataFrame() {
|
||||||
const df1 = new MutableDataFrame({
|
const df1 = new MutableDataFrame({
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import uPlot, { AlignedData } from 'uplot';
|
import uPlot, { AlignedData } from 'uplot';
|
||||||
|
import { VizLegendOptions, LegendDisplayMode } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
DataFrame,
|
DataFrame,
|
||||||
formattedValueToString,
|
formattedValueToString,
|
||||||
@ -10,13 +11,11 @@ import {
|
|||||||
import {
|
import {
|
||||||
Themeable2,
|
Themeable2,
|
||||||
UPlotConfigBuilder,
|
UPlotConfigBuilder,
|
||||||
VizLegendOptions,
|
|
||||||
UPlotChart,
|
UPlotChart,
|
||||||
VizLayout,
|
VizLayout,
|
||||||
AxisPlacement,
|
AxisPlacement,
|
||||||
ScaleDirection,
|
ScaleDirection,
|
||||||
ScaleOrientation,
|
ScaleOrientation,
|
||||||
LegendDisplayMode,
|
|
||||||
PlotLegend,
|
PlotLegend,
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
|
|
||||||
|
@ -3,14 +3,8 @@
|
|||||||
// It is currenty hand written but will serve as the target for cuetsy
|
// It is currenty hand written but will serve as the target for cuetsy
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
import {
|
import { LegendDisplayMode, OptionsWithLegend, OptionsWithTooltip, TooltipDisplayMode } from '@grafana/schema';
|
||||||
GraphGradientMode,
|
import { GraphGradientMode, HideableFieldConfig } from '@grafana/ui';
|
||||||
HideableFieldConfig,
|
|
||||||
LegendDisplayMode,
|
|
||||||
OptionsWithLegend,
|
|
||||||
OptionsWithTooltip,
|
|
||||||
TooltipDisplayMode,
|
|
||||||
} from '@grafana/ui';
|
|
||||||
|
|
||||||
export const modelVersion = Object.freeze([1, 0]);
|
export const modelVersion = Object.freeze([1, 0]);
|
||||||
|
|
||||||
|
@ -4,7 +4,8 @@ import { Field, FieldColorModeId, getColorForTheme, GrafanaTheme } from '@grafan
|
|||||||
import { identity } from 'lodash';
|
import { identity } from 'lodash';
|
||||||
import { Config } from './layout';
|
import { Config } from './layout';
|
||||||
import { css } from '@emotion/css';
|
import { css } from '@emotion/css';
|
||||||
import { Icon, LegendDisplayMode, useStyles, useTheme, VizLegend, VizLegendItem, VizLegendListItem } from '@grafana/ui';
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
|
import { Icon, useStyles, useTheme, VizLegend, VizLegendItem, VizLegendListItem } from '@grafana/ui';
|
||||||
|
|
||||||
function getStyles() {
|
function getStyles() {
|
||||||
return {
|
return {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { FC, useCallback } from 'react';
|
import React, { FC, useCallback } from 'react';
|
||||||
|
import { VizTooltipOptions } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
FieldDisplay,
|
FieldDisplay,
|
||||||
FALLBACK_COLOR,
|
FALLBACK_COLOR,
|
||||||
@ -9,7 +9,6 @@ import {
|
|||||||
DataHoverEvent,
|
DataHoverEvent,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
import {
|
import {
|
||||||
VizTooltipOptions,
|
|
||||||
useTheme2,
|
useTheme2,
|
||||||
useStyles2,
|
useStyles2,
|
||||||
SeriesTableRowProps,
|
SeriesTableRowProps,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
DataHoverClearEvent,
|
DataHoverClearEvent,
|
||||||
DataHoverEvent,
|
DataHoverEvent,
|
||||||
@ -14,7 +15,6 @@ import { PieChart } from './PieChart';
|
|||||||
import { PieChartLegendOptions, PieChartLegendValues, PieChartOptions } from './types';
|
import { PieChartLegendOptions, PieChartLegendValues, PieChartOptions } from './types';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import {
|
import {
|
||||||
LegendDisplayMode,
|
|
||||||
SeriesVisibilityChangeBehavior,
|
SeriesVisibilityChangeBehavior,
|
||||||
usePanelContext,
|
usePanelContext,
|
||||||
useTheme2,
|
useTheme2,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { FieldColorModeId, FieldConfigProperty, FieldMatcherID, PanelModel } from '@grafana/data';
|
import { FieldColorModeId, FieldConfigProperty, FieldMatcherID, PanelModel } from '@grafana/data';
|
||||||
import { LegendDisplayMode } from '@grafana/ui';
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import { PieChartPanelChangedHandler } from './migrations';
|
import { PieChartPanelChangedHandler } from './migrations';
|
||||||
import { PieChartLabels } from './types';
|
import { PieChartLabels } from './types';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { FieldColorModeId, FieldConfigProperty, FieldMatcherID, PanelModel } from '@grafana/data';
|
import { FieldColorModeId, FieldConfigProperty, FieldMatcherID, PanelModel } from '@grafana/data';
|
||||||
import { LegendDisplayMode } from '@grafana/ui';
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import { PieChartOptions, PieChartLabels, PieChartLegendValues, PieChartType } from './types';
|
import { PieChartOptions, PieChartLabels, PieChartLegendValues, PieChartType } from './types';
|
||||||
|
|
||||||
export const PieChartPanelChangedHandler = (
|
export const PieChartPanelChangedHandler = (
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { FieldColorModeId, FieldConfigProperty, PanelPlugin } from '@grafana/data';
|
import { FieldColorModeId, FieldConfigProperty, PanelPlugin } from '@grafana/data';
|
||||||
import { PieChartPanel } from './PieChartPanel';
|
import { PieChartPanel } from './PieChartPanel';
|
||||||
import { PieChartOptions, PieChartType, PieChartLabels, PieChartLegendValues } from './types';
|
import { PieChartOptions, PieChartType, PieChartLabels, PieChartLegendValues } from './types';
|
||||||
import { LegendDisplayMode, commonOptionsBuilder } from '@grafana/ui';
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
|
import { commonOptionsBuilder } from '@grafana/ui';
|
||||||
import { PieChartPanelChangedHandler } from './migrations';
|
import { PieChartPanelChangedHandler } from './migrations';
|
||||||
import { addStandardDataReduceOptions } from '../stat/types';
|
import { addStandardDataReduceOptions } from '../stat/types';
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { OptionsWithTooltip, SingleStatBaseOptions, VizLegendOptions } from '@grafana/ui';
|
import { VizLegendOptions, OptionsWithTooltip } from '@grafana/schema';
|
||||||
|
import { SingleStatBaseOptions } from '@grafana/ui';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @beta
|
* @beta
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { LegendDisplayMode } from '@grafana/schema';
|
||||||
import {
|
import {
|
||||||
PanelContext,
|
PanelContext,
|
||||||
PanelContextRoot,
|
PanelContextRoot,
|
||||||
GraphNG,
|
GraphNG,
|
||||||
GraphNGProps,
|
GraphNGProps,
|
||||||
BarValueVisibility,
|
BarValueVisibility,
|
||||||
LegendDisplayMode,
|
|
||||||
UPlotConfigBuilder,
|
UPlotConfigBuilder,
|
||||||
VizLayout,
|
VizLayout,
|
||||||
VizLegend,
|
VizLegend,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { HideableFieldConfig, BarValueVisibility, OptionsWithLegend, OptionsWithTooltip } from '@grafana/ui';
|
import { OptionsWithTooltip, OptionsWithLegend } from '@grafana/schema';
|
||||||
|
import { HideableFieldConfig, BarValueVisibility } from '@grafana/ui';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @alpha
|
* @alpha
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { VizLegendOptions } from '@grafana/schema';
|
||||||
import { XYFieldMatchers } from '@grafana/ui/src/components/GraphNG/types';
|
import { XYFieldMatchers } from '@grafana/ui/src/components/GraphNG/types';
|
||||||
import {
|
import {
|
||||||
ArrayVector,
|
ArrayVector,
|
||||||
@ -21,7 +22,6 @@ import {
|
|||||||
UPlotConfigBuilder,
|
UPlotConfigBuilder,
|
||||||
UPlotConfigPrepFn,
|
UPlotConfigPrepFn,
|
||||||
VizLegendItem,
|
VizLegendItem,
|
||||||
VizLegendOptions,
|
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
import { getConfig, TimelineCoreOptions } from './timeline';
|
import { getConfig, TimelineCoreOptions } from './timeline';
|
||||||
import { AxisPlacement, ScaleDirection, ScaleOrientation } from '@grafana/ui/src/components/uPlot/config';
|
import { AxisPlacement, ScaleDirection, ScaleOrientation } from '@grafana/ui/src/components/uPlot/config';
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { HideableFieldConfig, BarValueVisibility, OptionsWithTooltip, OptionsWithLegend } from '@grafana/ui';
|
import { HideableFieldConfig, BarValueVisibility } from '@grafana/ui';
|
||||||
|
import { OptionsWithTooltip, OptionsWithLegend } from '@grafana/schema';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @alpha
|
* @alpha
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Field, PanelProps } from '@grafana/data';
|
import { Field, PanelProps } from '@grafana/data';
|
||||||
import { config } from '@grafana/runtime';
|
import { config } from '@grafana/runtime';
|
||||||
import { usePanelContext, TimeSeries, TooltipPlugin, ZoomPlugin, TooltipDisplayMode } from '@grafana/ui';
|
import { TooltipDisplayMode } from '@grafana/schema';
|
||||||
|
import { usePanelContext, TimeSeries, TooltipPlugin, ZoomPlugin } from '@grafana/ui';
|
||||||
import { getFieldLinksForExplore } from 'app/features/explore/utils/links';
|
import { getFieldLinksForExplore } from 'app/features/explore/utils/links';
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { AnnotationsPlugin } from './plugins/AnnotationsPlugin';
|
import { AnnotationsPlugin } from './plugins/AnnotationsPlugin';
|
||||||
|
@ -18,14 +18,13 @@ import {
|
|||||||
GraphFieldConfig,
|
GraphFieldConfig,
|
||||||
GraphGradientMode,
|
GraphGradientMode,
|
||||||
GraphTresholdsStyleMode,
|
GraphTresholdsStyleMode,
|
||||||
LegendDisplayMode,
|
|
||||||
LineInterpolation,
|
LineInterpolation,
|
||||||
LineStyle,
|
LineStyle,
|
||||||
PointVisibility,
|
PointVisibility,
|
||||||
ScaleDistribution,
|
ScaleDistribution,
|
||||||
StackingMode,
|
StackingMode,
|
||||||
TooltipDisplayMode,
|
|
||||||
} from '@grafana/ui';
|
} from '@grafana/ui';
|
||||||
|
import { LegendDisplayMode, TooltipDisplayMode } from '@grafana/schema';
|
||||||
import { TimeSeriesOptions } from './types';
|
import { TimeSeriesOptions } from './types';
|
||||||
import { omitBy, pickBy, isNil, isNumber, isString } from 'lodash';
|
import { omitBy, pickBy, isNil, isNumber, isString } from 'lodash';
|
||||||
import { defaultGraphConfig } from './config';
|
import { defaultGraphConfig } from './config';
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
import { OptionsWithLegend, OptionsWithTooltip } from '@grafana/ui';
|
import { OptionsWithLegend, OptionsWithTooltip } from '@grafana/schema';
|
||||||
|
|
||||||
export interface TimeSeriesOptions extends OptionsWithLegend, OptionsWithTooltip {}
|
export interface TimeSeriesOptions extends OptionsWithLegend, OptionsWithTooltip {}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { OptionsWithTooltip, OptionsWithLegend } from '@grafana/ui';
|
import { OptionsWithTooltip, OptionsWithLegend } from '@grafana/schema';
|
||||||
export interface XYDimensionConfig {
|
export interface XYDimensionConfig {
|
||||||
frame: number;
|
frame: number;
|
||||||
x?: string; // name | first
|
x?: string; // name | first
|
||||||
|
Loading…
Reference in New Issue
Block a user