Package io.deephaven.plot.util
Class PlotUtils
java.lang.Object
io.deephaven.plot.util.PlotUtils
Utilities class for plotting.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<? extends Aggregation>
static Table
createCategoryHistogramTable
(Table t, String... byColumns) createCategoryPartitionedTableHandle
(Table t, String[] catColumns, String[] otherColumns, String[] byColumns, PlotInfo plotInfo) createCategoryPartitionedTableHandle
(Table t, String catColumn, String[] otherColumns, String[] byColumns, PlotInfo plotInfo) static Table
createCategoryTable
(Table t, String[] catColumns) static TableHandle
createCategoryTableHandle
(Table t, String[] catColumns, String... otherColumns) static TableHandle
createCategoryTableHandle
(Table t, String catColumn, String... otherColumns) static <T> IndexableData
createEmptyIndexableData
(Class<T> c, PlotInfo plotInfo) static IndexableNumericData
createEmptyIndexableNumericDataArray
(Class dataType, PlotInfo plotInfo) static <T> IndexableData
createIndexableData
(Table t, String column, PlotInfo plotInfo) static <T> IndexableData
createIndexableData
(Object data, PlotInfo plotInfo) static <T> IndexableData
createIndexableData
(Object data, Class<T> c, PlotInfo plotInfo) static <T> IndexableData
createIndexableData
(Map<String, Object> snapshotData, @NotNull TableDefinition tableDefinition, String column, PlotInfo plotInfo) static <T> IndexableData
static <T extends Comparable>
IndexableDatacreateIndexableData
(T[] data, PlotInfo plotInfo) static IndexableNumericData
createIndexableNumericDataArray
(Object data, Class dataType, PlotInfo plotInfo) static IndexableNumericData
createIndexableNumericDataArray
(Map<String, Object> data, @NotNull TableDefinition tableDefinition, String column, PlotInfo plotInfo) static IndexableNumericData
createIndexableNumericDataArray
(Map<String, Object> data, @NotNull Table t, String column, PlotInfo plotInfo) static IndexableNumericData
createIndexableNumericDataArray
(Map<String, Object> data, @NotNull TableHandle th, String column, PlotInfo plotInfo) static Table
doubleTable
(double[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(float[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(int[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(long[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(short[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(Double[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(Float[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(Integer[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(Long[] x, String colName) Creates a new table with a column of doubles holding the specified data.static Table
doubleTable
(Short[] x, String colName) Creates a new table with a column of doubles holding the specified data.doubleTable
(List<T> x, String colName) Creates a new table with a column of doubles holding the specified data.doubleTable
(T[] x, String colName) Creates a new table with a column of doubles holding the specified data.getColumnConditions
(Table arg, String column) static Color[]
getNColors
(ColorPalette colorPalette, int n) Gets theColor
array for this palette.getNumberFromNumericOrTimeSource
(Table t, String numericCol, PlotInfo plotInfo) static Paint
intToColor
(ChartImpl chart, Integer color) Deprecated.static Paint
intToColor
(Integer color) static double
maxIgnoreNaN
(double... values) static double
maxIgnoreNaN
(double oldMin, double value) static float
maxIgnoreNaN
(float oldMin, float value) static int
maxIgnoreNull
(int oldMin, int value) static long
maxIgnoreNull
(long oldMin, long value) static short
maxIgnoreNull
(short oldMin, short value) static double
minIgnoreNaN
(double... values) static double
minIgnoreNaN
(double oldMin, double value) static float
minIgnoreNaN
(float oldMin, float value) static int
minIgnoreNull
(int oldMin, int value) static long
minIgnoreNull
(long oldMin, long value) static short
minIgnoreNull
(short oldMin, short value) static double
Gets the double equivalent of theNumber
.static Table
Creates a new table with a column of doubles holding the specified data.static Table
Creates a new table with a column of floats holding the specified data.static Table
Creates a new table with a column of ints holding the specified data.static Table
Creates a new table with a column of longs holding the specified data.static Table
Creates a new table with a column of shorts holding the specified data.static <T> Table
Creates a new table with a column holding the specified data.static <T> Table
Creates a new table with a column holding the specified data.static double[]
toDouble
(float[] x) Creates a new array of doubles holding the specified data.static double[]
toDouble
(int[] x) Creates a new array of doubles holding the specified data.static double[]
toDouble
(long[] x) Creates a new array of doubles holding the specified data.static <T extends Number>
double[]toDouble
(T[] x) Creates a new array of doubles holding the specified data.static float[]
toFloat
(double[] x) Creates a new array of floats holding the specified data.static float[]
toFloat
(int[] x) Creates a new array of floats holding the specified data.static float[]
toFloat
(long[] x) Creates a new array of floats holding the specified data.static <T extends Number>
float[]toFloat
(T[] x) Creates a new array of floats holding the specified data.static String
uniqueVarName
(String root) Gets a variable name not already in theQueryScope
by appending random integers to the end ofroot
until a unique name is found.
-
Method Details
-
uniqueVarName
Gets a variable name not already in theQueryScope
by appending random integers to the end ofroot
until a unique name is found.- Parameters:
root
- base variable name- Returns:
- unique randomized variable name based off
root
-
intToColor
Deprecated.Gets the color of thechart
's color palette at the specified indexcolor
.- Parameters:
chart
- chartcolor
- index- Returns:
- color of the
chart
at the indexcolor
-
intToColor
-
numberToDouble
Gets the double equivalent of theNumber
. NullQueryConstants
are converted to Double.NaN.- Parameters:
n
- number- Returns:
- double value of
n
- Throws:
UnsupportedOperationException
-n
isn't a supported data type
-
table
Creates a new table with a column holding the specified data.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
table
Creates a new table with a column holding the specified data.- Type Parameters:
T
- type of the data inx
- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
table
Creates a new table with a column of shorts holding the specified data.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
table
Creates a new table with a column of ints holding the specified data.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
table
Creates a new table with a column of longs holding the specified data.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
table
Creates a new table with a column of floats holding the specified data.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
table
Creates a new table with a column of doubles holding the specified data.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Type Parameters:
T
- type of the data inx
- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Type Parameters:
T
- type of the data inx
- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
doubleTable
Creates a new table with a column of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- datacolName
- column name- Returns:
- new table with column holding
x
-
toFloat
public static float[] toFloat(double[] x) Creates a new array of floats holding the specified data. Values ofx
are converted to their corresponding float values. Nulls are mapped to Float.NaN.- Parameters:
x
- data- Returns:
- new float array holding
x
-
toFloat
public static float[] toFloat(int[] x) Creates a new array of floats holding the specified data. Values ofx
are converted to their corresponding float values. Nulls are mapped to Float.NaN.- Parameters:
x
- data- Returns:
- new float array holding
x
-
toFloat
public static float[] toFloat(long[] x) Creates a new array of floats holding the specified data. Values ofx
are converted to their corresponding float values. Nulls are mapped to Float.NaN.- Parameters:
x
- data- Returns:
- new float array holding
x
-
toFloat
Creates a new array of floats holding the specified data. Values ofx
are converted to their corresponding float values. Nulls are mapped to Float.NaN.- Type Parameters:
T
- type of the data inx
- Parameters:
x
- data- Returns:
- new float array holding
x
-
toDouble
public static double[] toDouble(float[] x) Creates a new array of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- data- Returns:
- new float array holding
x
-
toDouble
public static double[] toDouble(int[] x) Creates a new array of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- data- Returns:
- new float array holding
x
-
toDouble
public static double[] toDouble(long[] x) Creates a new array of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Parameters:
x
- data- Returns:
- new float array holding
x
-
toDouble
Creates a new array of doubles holding the specified data. Values ofx
are converted to their corresponding double values. Nulls are mapped to Double.NaN.- Type Parameters:
T
- type of the data inx
- Parameters:
x
- data- Returns:
- new float array holding
x
-
getNColors
Gets theColor
array for this palette.- Returns:
- Array of
Color
for this palette.
-
minIgnoreNaN
public static double minIgnoreNaN(double... values) -
minIgnoreNaN
public static double minIgnoreNaN(double oldMin, double value) -
maxIgnoreNaN
public static double maxIgnoreNaN(double... values) -
maxIgnoreNaN
public static double maxIgnoreNaN(double oldMin, double value) -
minIgnoreNaN
public static float minIgnoreNaN(float oldMin, float value) -
maxIgnoreNaN
public static float maxIgnoreNaN(float oldMin, float value) -
minIgnoreNull
public static int minIgnoreNull(int oldMin, int value) -
maxIgnoreNull
public static int maxIgnoreNull(int oldMin, int value) -
minIgnoreNull
public static short minIgnoreNull(short oldMin, short value) -
maxIgnoreNull
public static short maxIgnoreNull(short oldMin, short value) -
minIgnoreNull
public static long minIgnoreNull(long oldMin, long value) -
maxIgnoreNull
public static long maxIgnoreNull(long oldMin, long value) -
createCategoryTableHandle
public static TableHandle createCategoryTableHandle(Table t, String catColumn, String... otherColumns) -
createCategoryTableHandle
public static TableHandle createCategoryTableHandle(Table t, String[] catColumns, String... otherColumns) -
createCategoryPartitionedTableHandle
-
createCategoryPartitionedTableHandle
-
createCategoryTable
-
createCategoryHistogramTable
-
createCategoryAggs
-
getColumnConditions
-
getNumberFromNumericOrTimeSource
-
createIndexableData
-
createIndexableData
public static <T> IndexableData createIndexableData(Map<String, Object> snapshotData, @NotNull @NotNull TableDefinition tableDefinition, String column, PlotInfo plotInfo) -
createIndexableData
-
createEmptyIndexableData
-
createIndexableData
-
createIndexableData
-
createIndexableData
-
createIndexableNumericDataArray
public static IndexableNumericData createIndexableNumericDataArray(Map<String, Object> data, @NotNull @NotNull TableHandle th, String column, PlotInfo plotInfo) -
createIndexableNumericDataArray
-
createIndexableNumericDataArray
public static IndexableNumericData createIndexableNumericDataArray(Map<String, Object> data, @NotNull @NotNull TableDefinition tableDefinition, String column, PlotInfo plotInfo) -
createEmptyIndexableNumericDataArray
public static IndexableNumericData createEmptyIndexableNumericDataArray(Class dataType, PlotInfo plotInfo) -
createIndexableNumericDataArray
public static IndexableNumericData createIndexableNumericDataArray(Object data, Class dataType, PlotInfo plotInfo)
-