lgsinnovations / sigplot Goto Github PK
View Code? Open in Web Editor NEWSigPlot provides fast interactive web-plotting for software defined radio.
Home Page: https://sigplot.lgsinnovations.com
License: Apache License 2.0
SigPlot provides fast interactive web-plotting for software defined radio.
Home Page: https://sigplot.lgsinnovations.com
License: Apache License 2.0
When I remove all layers and change xmin/max after I overlay a new layer the view gets set incorrectly.
I expect the view to have the whole array in view.
Using Menu -> View ->Y Axis ->expand Full Menu -> View ->X Axis ->expand Full
Also doesn't set the view to what is expected. I would expect xmin to be 3 but it gets set to -1
d = document.createElement("div")
d.style = "height:500px"
b = document.querySelector("body")
b.innerText = "";
b.appendChild(d)
plot = new sigplot.Plot(d)
plot.remove_layer(0);
plot.overlay_array([1,2,3,4,5,6]);
plot.change_settings({
xmin: 1,
xmax: 6
});
plot.remove_layer(0);
plot.overlay_array([3,4,5,6,7]);
plot.change_settings({
xmin: 3,
xmax: 7
});
Describe the bug
When the no_legend_button option is passed into the Sigplot constructor and you have a real-time 1D plot, the readout will show briefly when you mouse over but will disappear the next time the layer is updated.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Readout should stay constant, no_legend_button has nothing to do with readout.
jsFiddle
https://jsfiddle.net/wavLjygo/2/
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
The canvas-based menu should columnate when the plot's height decreases below the size of the menu.
Describe the solution you'd like
I'd like the menu to columnate when the plot's height decreases below the menu's height. It should continue to columnate as much as it can.
Describe alternatives you've considered
The DOM menu would be an alternative that might not have this issue.
Additional context
XPLOT/XRASTER does this.
In unittest 63 the pulse train does not load.
The plot options does not support cmap = 0, but other cmap settings are allowed.
Is your feature request related to a problem? Please describe.
This is either a feature request or question about how to use an existing feature. I use the accordion lines in graphs right now and find them very useful as a visual guide, but I would like to put labels next to the accordion lines, simple ones like 1, 2, 3, 4.... for some reason I thought this existed already but I'm not seeing it anywhere...
Describe the solution you'd like
see above
Describe alternatives you've considered
If there is a way to define putting text anywhere on the diagram I could figure out how to put it next to an accordion trace, but that would be harder...
Additional context
Describe the bug
m.initialize has a bug setting the subsize if the array input is array of data views
To Reproduce
data = [new DataView(new ArrayBuffer(10))];
plot.overlay_array(data);//throw "subsize must be provided with type 2000 files";
Expected behavior
The code allows arrays of Dataviews to be set and attempts to get the length for the subsize using data[0].length. However, dataviews it should be data[0].byteLength
Additional context
Fix should be
else if (Array.isArray(data) && (Array.isArray(data[0]) || ArrayBuffer.isView(data[0]))) {
//If this is a 2-D array automatically set subsize
hcb.type = 2000;
hcb.subsize = ArrayBuffer.isView(data[0]) ? data[0].byteLength: data[0].length;
hcb.size = data.length;
}
I have a type 1000 bluefile, when I use fft_plot.overlay_href("filename", null, {name: "FFT"}); it doesn't plot correctly. I tried to look at the sample file at http://demo.axiosengineering.com/sigplot/assets/dat/fsk_fft.tmp it doesn't exsist. I was hopeping to see the structure of that file.
Describe the bug
Using version 2.0.0-rc2 which is believed to be hash bf788b7.
I am using overlay_href to raster the attached type 2000 blue file. When I hit 'x' to x-cut the raster, the X_CUT mode plots in index rather then abscissa mode. So I have to zoom down to 0-511 Hz to find my x-cut.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
x-cut should be drawn matching the raster (i.e. abscissa mode or index mode)
jsFiddle
jsFiddle plotter does not seem to have x-cut available
Screenshots
raster.tmp.gz
Desktop (please complete the following information):
Is your feature request related to a problem? Please describe.
I am using type 1D and it is displaying all layers of my type 2000 file. I was wondering how to set up sigplot to only display the 1st layer or only the second layer. This is not really an enhancement, I'm hoping the capability already exists.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Describe the bug
plot.overlay_href
does not return the layer that was created (despite the docs saying it does).
To Reproduce
Steps to reproduce the behavior:
var layer = plot.overlay_href('dat/penny.prm', null, {});
console.log(layer); // => undefined
Expected behavior
plot.overlay_href
should return the layer index for the layer that was created.
jsFiddle
N/A
Screenshots
N/A
Desktop (please complete the following information):
N/A
Smartphone (please complete the following information):
N/A
Additional context
overlay_href: function(href, onload, layerOptions) {
m.log.debug("Overlay href: " + href);
try {
this.show_spinner();
var handleHeader = (function(plot, onload) {
return function(hcb) {
try {
if (!hcb) {
alert("Failed to load data");
} else {
var i;
if (href.endsWith(".mat")) {
i = plot.overlay_matfile(hcb, layerOptions);
} else {
i = plot.overlay_bluefile(hcb, layerOptions);
}
if (onload) {
onload(hcb, i);
}
}
} finally {
plot.hide_spinner();
}
};
}(this, onload));
var reader;
if (href.endsWith(".mat")) {
reader = new matfile.MatFileReader();
} else {
reader = new bluefile.BlueFileReader();
}
reader.read_http(href, handleHeader);
} catch (error) {
console.error(error);
alert("Failed to load data");
this.hide_spinner();
}
},
Is your feature request related to a problem? Please describe.
While raster plots are very useful, in some cases a 3d surface plot provides additional information
Describe the solution you'd like
Implement an option to display a faster as either a falling raster or as a surface plot
Describe alternatives you've considered
None
Additional context
None
Describe the bug
I am exploring the raster (2D) static plot as an option for a project I am working on. I will be plotting a 64x64 grid of values. I began by plotting a random set of 64x64 values (see this fiddle) and that looked great. Then, I attempted to plot columns of fixed values, for example:
[
[0,1,2,3,...,61,62,63],
[0,1,2,3,...,61,62,63],
[0,1,2,3,...,61,62,63],
...
[0,1,2,3,...,61,62,63],
[0,1,2,3,...,61,62,63],
[0,1,2,3,...,61,62,63],
]
and this too produced the expected result (see this fiddle). For some reason though, when I plot rows of fixed values such as:
[
[0,0,0,0,...,0,0,0],
[1,1,1,1,...,1,1,1],
[2,2,2,2,...,2,2,2],
...
[61,61,61,61,...,61,61,61],
[62,62,62,62,...,62,62,62],
[63,63,63,63,...,63,63,063
]
this does not yield the expected result. I would expect a steady gradient from top to bottom (basically a rotated version of the prior one) but instead I get a steady gradient for about ~15 rows, followed by ~48 (the remaining) rows being displayed at "max" value color (see this fiddle)
I can not figure out what would cause this. Any guidance would be greatly appreciated! Great tool!
Describe the bug
Fix to Legend that removed black box in the legend for Layer2D caused trace menu to not appear when the user presses the left mouse button. Works fine with single trace sigplots.
To Reproduce
Steps to reproduce the behavior:
Create 2D trace with more than one trace.
Press L in upper right
Press left mouse button
Should see a menu pop up to allow user to turn on/off trace or change thickness etc.. But it doesn't show up.
ymin
and ymax
are apparently expected to be specified in linear units even when the plot is in log mode. This makes code very confusing as you see a number like 5.62341325e-7 in the code to get the bottom of my plot to be at -125.
Suggest either expecting a value in log scale already for these modes, or adding another option that specifies in which scale the user is specifying them.
Unit test 47 checks that the display says "Unknown (U)" for consistency with legacy X Plot behavior. The plot actually shows "None (Y)"
You can specify xcmp
to a raster on construction, but not with change_settings
. You have to reach in to Gx_.xcompression
to change it programmatically at run time. I'd like to be able to change this while the raster is running to reveal or highlight features as needed by the contents.
Ideally, this would also be available from the MM menu. (It may be, but just masked by the fact that my SigPlot instance is only 200 px high, so menus are truncated.)
I think we had gotten something related to this into the 1.4 series, but I don't see it in current master.
We ran into a problem some time ago related to the display of specs. It's been long enough that we lost some of the details, but we think it was something like: turn off both axes, then back on again, and the specs area disappears.
This patch against a built sigplot-debug.js fixed the issue for us:
sigplot-debug.js.show_specs.patch.gz
The patch just factors the check for show_readout
separately from (Gx.pan && !Gx.no_legend_button)
.
Describe the bug
Trying to update from 2.0.0. RC7 which does not have spin.js , but references it, want to know if there are other files/packages required by sigplot that aren't included in the tzg or zip.
To Reproduce
Steps to reproduce the behavior:
No steps. The new version of sigplot.js doesn't run because it can't find spin. Looking at the baselines in GIT spin.js doesn't appear to be part of the baselines RC9 and above; wondering where it is not found.
Describe the bug
Going into and immediately back out of CMODE 10log10 with the mouse leads to incorrect scales.
To Reproduce
If I change CX mode to 10log10, then immediately back to real/magnitude (whatever it was originally), the scale is off. MM "Expand Full" on Y thumb leads to another wrong scale. LM zoom followed by unzoom restores the scale as expected.
I've seen this on a variety of files, although it's more obvious on some than others.
Expected behavior
I think that changing back to the original display mode should reset the viewport to what it was originally.
jsFiddle
The fiddle https://jsfiddle.net/ha09baqu/ actually demonstrates it if you turn off autohide_panbars
.
Desktop (please complete the following information):
Additional context
Not sure if this is related to #14
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
We have a difficult time seeing what color the accordion bars are in our plots because the bars are not wide enough.
Describe the solution you'd like
A clear and concise description of what you want to happen.
I would like to change the edge_line_style so that i can change the thickness, it appears i can only change the color with that attribute.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
none
Additional context
Add any other context or screenshots about the feature request here.
Create a 10log10 raster plot, then create an x cut. The data created appears to be 10log10 of the 10log10 data instead of just displaying the data in 10log10.
I am having an issue in plotting more data than 32768 points. I am using mWidgets to get my data into sigplot, and I have verified that the correct number of points is being transferred to my midas.Pipe.
example 1: If I try to plot a 64k point FFT, only 32k points will show up in sigplot. If I select "Expand Full" on the bottom slider, the plot will momentarily expand to all 64k points wide, only plotting 32k points, and will immediately resize back to only 32k points shown.
example 2: If I try to plot a 128k point FFT, only 32k points will show up in sigplot. If I select "Expand Full" on the bottom slider, the plot will momentarily expand to all 128k points wide, only plotting 32k points, and will immediately resize back to only 128k points shown.
When using Layer1D with fillStyle
, the fill is draw on top of symbols
Describe the bug
P-cut can render outside of p-cut area.
To Reproduce
Using the test file on issue #24 enable pcuts.
Screenshots
Use Layer1D to draw a line of 12 points and notice the last two symbols are not rendered.
Describe the bug
Performing an X-Cut in a raster appears to go to the next trace instead of the current one.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would think the X-Cut should match the trace under the cursor when you press the X key, it appears to round up so at 0.5 Y index it prints trace 1 and at 1.5 Y index it prints trace 2.
jsFiddle
If possible, demonstrate the issue by forking this jsFiddle and providing a link to your jsFiddle in the bug report.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Describe the bug
The attached patch (against a built sigplot-debug.js
) fixes an apparently erroneous use of hcb.size
instead of size
. This is the only instance that my search-fu found, but there may be others that I missed.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Sorry, this may not be a feature request. I just can't find the documentation on what options can be sent into sigplot.Plot
I need to set the z axis min and max values on a 2d plot (raster)
Describe the solution you'd like
A clear and concise description of what you want to happen.
I would like to know where to find the documentation on all the options I can use in sigplot.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
sigplot/js/sigplot.accordion.js
Lines 429 to 451 in 5bae787
this.dragging
and this.edge_dragging
are set to false just before the if-statement that returns if one of them is false.
Furthermore, I believe the if-statement logic is incorrect. this.dragging
is set to true if the center is being dragged, and this.edge_dragging
is true if the edge is being dragged. They are never both true at the same time it appears, so the if-statement will always be truthy and the event never fired.
It's confusing for 6 to mean triangle. Allow symbols to be defined using either name or number.
This one is odd. I'm getting this exception which is causing issues with the plot using the correct xstart/xdelta when using downscale max and xcmp of 0. JSFiddle of this issue reproduced is here:
https://jsbin.com/xifenaqoso/1/edit?js,output
Try showing the console in the jsfiddle and then resizing the output. There are some points that cause these exceptions in the console.
Uncaught TypeError: Cannot read property 'color' of undefined
at scaleImage (mx.js?acfb:5308)
at renderImageTypedArrays (mx.js?acfb:5195)
at Function.mx.draw_image (mx.js?acfb:5632)
at Layer2D.draw (sigplot.layer2d.js?5242:990)
at draw_layer (sigplot.js?501f:7497)
at draw_layers (sigplot.js?501f:7473)
at Plot._refresh (sigplot.js?501f:3880)
at eval (sigplot.js?501f:3158)
at eval (mx.js?acfb:559)
Is your feature request related to a problem? Please describe.
I would like to change a Layer2D static spectral plot (waterfall plot) that is currently being displayed on the screen to a set of individual colored traces, i.e. if the waterfall plot has 8 rows, create an 8 trace plot (either flat or 3d, doesn't matter to me). I know how to do it in software, but I was wondering if you can do it interactively on the screen, i.e. the user can switch between the two plotting formats via the built in menu. I don't see it as an option, but maybe I'm missing something.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The attached patch (against a built sigplot-debug.js
) allows specifying cmode as an int on construction, as you already can in change_settings
:
sigplot-debug.js.allow_cmode_int.patch.gz
Of course, it is the feature, not the specific text of the patch, that matters.
A SigPlot instance always displays a colorbar, even if all layers are 1d. Since the colorbar is not related to the display in this case, it seems extraneous.
I believe the relevant code is in display_specs
. There's a conditional which checks whether to display a large colorbar based on Gx.lg_colorbar
AND the class of layer zero. The else clause unconditionally draws a colorbar:
if (Gx.lg_colorbar && (Gx.lyr[0].hcb["class"] === 2)) {
// settings for large colorbar
} else {
// settings for small colorbar
}
mx.colorbar(...);
If we separate the class check from the large/small check, we could skip the drawing altogether:
if (Gx.lyr[0].hcb["class"] === 2) {
if (Gx.lg_colorbar) {
// settings for large colorbar
} else {
// settings for small colorbar
}
mx.colorbar(...);
}
An alternative would be to have another option explicitly controlling whether the colorbar is drawn, but that seems less humane to me for the straightforward case.
The GreyScale color map uses the legacy style of color map definitions where there are always seven entries, but multiple entries are a pos 100. This means that if you plot binary data (i.e. only zeros and ones) the plot will be rendered all black.
The Ramer-Douglas-Peucker algorithm reduces the number of points that need to be plot, thereby reducing the number of points that need to be sent from the server.
Another source: https://www.influxdata.com/blog/the-algorithm-that-ties-together-google-maps-and-influxdatas-giraffe/
When xcmp is used on a plot where the number of x-bins is less than the number of pixels, the plot is rendered incorrectly.
Is your feature request related to a problem? Please describe.
I really like the accordion feature, but would like to be able to lock the according to the location on the X Axis and with a given width that I put it at and not let the user change it when zooming and panning. We find the users will inadvertently select one of the colored vertical accordion bars when zooming which then changes them.
Describe the solution you'd like
See above
Describe alternatives you've considered
N/A
Additional context
N/A
I often find myself using SigPlot in elements that are too small for the canvas-based menu to show all options. I've heard this from a few others around my place too. This issue is just to capture the desire to finish merging the DOM-based menu logic so that menus will work regardless of containing element size.
Describe the bug
When displaying a type 2000 file in 1D mode there is a black rectangle in the left side of the legend
To Reproduce
Steps to reproduce the behavior:
Create a plot
Set the Layer type as 1D (sigplot.Layer1D)
Plot a type 2000 file using overlay
Verify each element in the 2000 file is displayed, i.e. if it's 4 deep that 4 color traces appear
Press the L in the upper right corner
Verify that all the elements are indicated in the legend with a .001,.002 suffix.
See that there is a black rectangle in the left side of the legend covering the first part of the name of the file. The rectangle gets taller as there are more entries. Around the first 8 characters of the names are covered, as well as the colored lines. IF YOU TOGGLE OFF all of the elements in the file, the black rectangle goes away. Toggling back on one of the elements makes the rectangle reappear.
Expected behavior
See that there is a black rectangle in the left side of the legend covering the first part of the name of the file. This is NOT shown in the penny.prm file on the sigplot web site under:
https://sigplot.lgsinnovations.com/sigplot-2.0/inaction.html
where it is a 1D representation of 2D data.
jsFiddle
None
Screenshots
None
Desktop (please complete the following information):
Same results with Microsoft Edge and Firefox
Smartphone (please complete the following information):
None
Additional context
None
2 dimensional plots have an 'xcmp' flag that could be useful for 1 dimensional plots as well.
It would enable methods for 'combining' points that otherwise map to the same pixel on the screen.
Current behavior: the creation of the layer (e.g., overlay_pipe
) establishes the z-order of the layer when drawing each layer.
What we would like to do is re-order layers in the event a signal on layer 1 needs to temporarily be displayed ahead of layer 0 (0 and 1 being indices into the layer list).
plot.change_settings(xi=True)
is the same as plot.change_settings(xi=False)
Describe the bug
Plotting scalar packed files on larger (~15 MB) files (i.e., overlay_href
) is currently inefficient. Changing SP to SB on the server-side, while space-inefficient, speeds up plotting. Also, plotting SP blocks the entire page, so if you have multiple plots and the SP overlay_href triggers first, none of the other plots will render until SP is done.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.