version bump
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hediet/visualization-bundle",
|
||||
"description": "Bundles several visualizers",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"dev": "tsc --watch",
|
||||
@@ -50,9 +50,6 @@
|
||||
"@types/plotly.js": "^1.50.16",
|
||||
"@types/react": "^16.9.22",
|
||||
"@types/react-dom": "^16.9.5",
|
||||
"@types/react-measure": "^2.0.6",
|
||||
"@types/react-plotly.js": "^2.2.4",
|
||||
"@types/react-svg-pan-zoom": "^3.3.0",
|
||||
"@types/webpack": "^4.41.6",
|
||||
"ts-loader": "^6.2.1",
|
||||
"ts-node": "^8.6.2",
|
||||
|
||||
18
visualization-bundle/src/types.d.ts
vendored
Normal file
18
visualization-bundle/src/types.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
declare module "react-measure" {
|
||||
const content: any;
|
||||
export default content;
|
||||
|
||||
export type ContentRect = any;
|
||||
}
|
||||
|
||||
declare module "react-plotly.js" {
|
||||
const content: any;
|
||||
export default content;
|
||||
}
|
||||
|
||||
declare module "react-svg-pan-zoom" {
|
||||
export class Tool { }
|
||||
export type ReactSVGPanZoom = any;
|
||||
export const ReactSVGPanZoom = undefined as any;
|
||||
export class Value { }
|
||||
}
|
||||
@@ -37,7 +37,13 @@ export class AstTree extends React.Component<{
|
||||
}
|
||||
return (
|
||||
<Measure client>
|
||||
{({ measureRef, contentRect }) => {
|
||||
{({
|
||||
measureRef,
|
||||
contentRect,
|
||||
}: {
|
||||
measureRef: any;
|
||||
contentRect: any;
|
||||
}) => {
|
||||
return (
|
||||
<div
|
||||
ref={measureRef}
|
||||
|
||||
@@ -74,7 +74,13 @@ export class SvgViewer extends React.Component<{
|
||||
}
|
||||
}}
|
||||
>
|
||||
{({ measureRef, contentRect }) => (
|
||||
{({
|
||||
measureRef,
|
||||
contentRect,
|
||||
}: {
|
||||
measureRef: any;
|
||||
contentRect: any;
|
||||
}) => (
|
||||
<div
|
||||
ref={measureRef}
|
||||
className="svgViewer"
|
||||
@@ -85,7 +91,7 @@ export class SvgViewer extends React.Component<{
|
||||
height={heightOrDefault(contentRect)}
|
||||
tool={tool}
|
||||
value={val as any}
|
||||
onChangeValue={v => (this.value = v)}
|
||||
onChangeValue={(v: any) => (this.value = v)}
|
||||
onChangeTool={this.setTool}
|
||||
ref={this.svgPanZoomRef}
|
||||
toolbarProps={{
|
||||
|
||||
@@ -4,7 +4,10 @@ import { Properties } from "csstype";
|
||||
|
||||
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
||||
|
||||
export function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {
|
||||
export function omit<T extends {}, K extends keyof T>(
|
||||
obj: T,
|
||||
keys: K[]
|
||||
): Omit<T, K> {
|
||||
const newObj: Omit<T, K> = {} as any;
|
||||
for (const [key, val] of Object.entries(obj)) {
|
||||
if (!keys.includes(key as K)) {
|
||||
|
||||
Reference in New Issue
Block a user