Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides an interactive system for data visualization, which aims to solve the technical problems.
The technical scheme adopted for solving the technical problems is as follows: in an interactive system for data visualization, the improvement comprising: comprises a data processing module, a data caching module and a browser-side visualization module,
The data processing module is used for carrying out format conversion on the user data;
The data caching module is connected with the browser-side visualization module and is used for temporarily storing the user data after format conversion and then sending the user data to the browser-side visualization module;
and the browser-side visualization module is used for visualizing the user data according to the user operation.
In the system, the user data is subjected to format conversion, namely, csv format data is converted into json data in web transmission.
In the system, the browser-side visualization module comprises a chart main body unit, an operator unit and a statistics unit,
The chart main body unit is used for drawing and displaying the data;
The operator unit is connected with the chart main body unit and is used for enabling the chart main body unit to re-plot and display data according to different operations in the operator unit;
the statistics unit is connected with the operator unit and is used for analyzing the data according to different operations in the operator unit and generating a visual chart.
In the above system, the drawing is that each data record is drawn as a point in the main body of the chart, and each data record includes x and y coordinate information and various label information.
In the above system, the operator unit includes a view component and a select component,
The view component is connected with the chart main body unit and comprises options of total, groups and samples, wherein the total option is an initial chart, and the groups option or the samples option shifts the points of the corresponding labels so that data are drawn and displayed separately according to groups or samples;
The Select component is connected with the main unit of the chart and is used for selecting data points and adjusting the sizes of the data points in the drawing.
In the above system, the displacement is that the number of categories of samples or groups is rooted and then rounded up to obtain the number of category labels corresponding to each row arrangement, and all types of labels are arranged in sequence to enable the chart to be located in the center of the browser.
In the above system, the operator unit further comprises a protein component for selecting data points and adjusting the color and transparency of the data points.
In the above system, the statistical unit comprises a histogram component and a pie chart component,
The histogram component is connected with the select component and the protein component and is used for counting the numerical sum of the labels of the data points after the data point set of the corresponding label is selected from the select component and the protein component, and drawing a histogram;
The pie chart component is connected with the select component and the protein component and is used for calculating the frequency of each category of the group label and drawing the pie chart after the data point set of the corresponding label is selected from the select component and the protein component.
The beneficial effects of the invention are as follows: and drawing the data according to the user operation, and generating a visualized statistical graph so as to facilitate a user system to intuitively and rapidly acquire information contained in a huge data matrix and realize interaction with the user.
Detailed Description
The invention will be further described with reference to the drawings and examples.
The conception, specific structure, and technical effects produced by the present invention will be clearly and completely described below with reference to the embodiments and the drawings to fully understand the objects, features, and effects of the present invention. It is apparent that the described embodiments are only some embodiments of the present invention, but not all embodiments, and that other embodiments obtained by those skilled in the art without inventive effort are within the scope of the present invention based on the embodiments of the present invention. In addition, all the coupling/connection relationships referred to in the patent are not direct connection of the single-finger members, but rather, it means that a better coupling structure can be formed by adding or subtracting coupling aids depending on the specific implementation. The technical features in the invention can be interactively combined on the premise of no contradiction and conflict.
Explanation of nouns herein:
The JSON data format, java ScriptObject Notation, is a lightweight data interchange format based on a subset of JavaScript (STANDARD ECMA-2623rd Edition-December 1999). JSON adopts a text format that is completely independent of language, but also uses habits similar to the C language family (including C, c++, c#, java, javaScript, perl, python, etc.). The characteristics make JSON an ideal data exchange language, easy for people to read and write, and easy for machines to analyze and generate, so that the network transmission speed is high, and the background interaction and the icon touch data change interaction are facilitated. It will contain a plurality of data items, each of which must contain a tag description, a specific value, but may of course also contain other additional information about the data item.
Referring to fig. 1, the invention provides an interactive system for data visualization, which comprises a data processing module, a data caching module and a browser-side visualization module, wherein the data processing module performs format conversion on uploaded user data in csv format, converts the user data into json data (Java ScriptObject Notation) in web transmission, and a user uploads the converted json data to the data caching module which is connected with the browser-side visualization module and is used for temporarily storing the user data after format conversion and then sending the user data to the browser-side visualization module; the browser-side visualization module is used for visualizing the user data according to the user operation, so that a user (e.g. a scientist) can conveniently, intuitively and rapidly acquire information contained in a huge data matrix, and interaction with the user is realized.
User data, referring to a very large number of individual attribute features and measured values of multiple features, attribute feature information includes: a sample (sample) to which the individual belongs, a group (group) of samples to which the individual belongs, and a category (cluster) to which the individual belongs. The plurality of features is by detecting the measured values that have been acquired. The data format may be a json file.
As one embodiment, a data cache server in the data cache module temporarily stores data for interaction with a browser. In general, the server can directly convert data and transmit the converted data to the browser, but the data are considered to be the data of the user, the report needs to be matched, and a user management system needs to be designed; and the data itself is bigger, and the performance is also affected by using one server for processing and transmitting the data. Therefore, the invention separately provides the data caching server, so that the user can take the json file and return the json file to the browser after uploading the json file (the data cannot be directly transmitted to the browser from the local place).
Further, the browser-side visualization module comprises a chart main body unit, an operator unit and a statistics unit,
The chart main body unit is used for drawing and displaying the data; drawing each data record into a point in the main body of the chart, wherein each data record comprises x and y coordinate information and various label information, and proteins are arranged in brackets of groups, samples and clusters (p 1, p2, p3 … … … px);
The svg chart is used for drawing, svg is vector graphic data, the operability is strong, and the problem of poor picture quality caused by low resolution is avoided. When drawing, firstly defining a svg canvas, determining the length and width of the canvas, traversing each data record in json data transmitted from a data caching module (namely a data caching server), converting the data record into corresponding pixel positions according to x and y coordinates of the data record, and drawing the data record into the svg canvas.
The operator unit is connected with the chart main body unit, and a user performs different operations in the operator unit to enable the chart main body unit to re-plot and display data;
Further, the operator unit comprises a view component and a select component, the view component is connected with the chart main unit and comprises options of total, groups and samples, the total option is an initial chart, and the groups option or the sample option shifts the points of the corresponding labels so that data can be drawn and displayed separately according to groups or samples; the displacement is that the number of categories of samples or groups is rooted and then rounded upwards to obtain the number of category labels corresponding to each row of arrangement, and all types of labels are arranged in sequence to enable the chart to be located in the center of the browser; the Select component is connected with the main unit of the chart and is used for selecting data points and adjusting the sizes of the data points in the drawing; further, the manipulator unit further comprises a protein component for selecting data points and adjusting the color and transparency of the data points;
the statistics unit is connected with the operator unit and is used for analyzing the data according to different operations in the operator unit and generating a visual chart.
2-4, In use, the operator unit may select a data point for a corresponding tag. The first view component may select total, groups, samples. total is the initial chart. Selecting groups or samples, the points corresponding to the labels may be shifted to achieve the effect of separating the data points by group or sample. The displacement strategy is as follows: the method comprises the steps of rooting the number of categories of samples or groups, then rounding up to obtain how many corresponding category labels are arranged in each row, and then arranging all the category labels in sequence to ensure that the chart is positioned in the center of the browser as much as possible. The second select component and the third protein component can modify the color, transparency, and size of the selected label data point to achieve the effect of highlighting the data point. When the Select component is selected, the size of the data point is increased, and in the non-selection state, the size of the point is kept as it is; when the Protein component is selected, the color size transparency of the data point is changed, for example, the p1 label is selected, the transparency of the data point without the p1 label is reduced, the p1 label is carried, the numerical value under the p1 label of the data point is converted into a number between 0 and 1, then the corresponding gradual change is given to the corresponding point, and meanwhile, the numerical value under the p1 label is given to the size of the point. When a plurality of labels are selected, such as p1 and p2 are selected, a switch button is arranged beside the protein component to control intersection or union, and union is selected, so that only the data point carrying one of the labels p1 and p2 is selected; intersection, only the points that two tags carry at the same time will be selected.
The manual selection method of the select component supports selection by long-press drawing selection through a mouse, and data points are in a manual selection state: the left mouse button is pressed down in the main body of the chart, then the mouse is moved, and an irregular graph formed by a small segment can be generated in the moving process of the mouse, namely a selected area. Drawing line segments in real time in the svg canvas creates a selection region. And releasing the left button of the mouse, and finishing the drawing of the selected area. And filling the color display selection area with the irregular graph in the svg canvas. Selected labels are added to the data points in the selected area, unselected labels are added to the points outside the selected area, and meanwhile transparency of the selected labels is reduced, so that the effect of free selection of the mouse is achieved.
The statistics unit comprises a histogram component and a pie chart component, wherein the histogram component is connected with the select component and the protein component and is used for counting the numerical sum of the labels of the data points after the data point sets of the corresponding labels are selected from the select component and the protein component, and drawing a histogram; the pie chart component is connected with the select component and the protein component and is used for calculating the frequency of each category of the group label and drawing the pie chart after the data point set of the corresponding label is selected from the select component and the protein component.
Referring to fig. 5 to 6, in use, the statistics unit counts the sum of the values of the (p 1, p2, p3 … px) tags of the data point sets of the corresponding tags after selecting the data point sets of the corresponding tags from the two component option areas for the select component and the protein component of the operation unit, and then draws a histogram. The pie chart is also a selected point for select and protein, the frequency of each category of group label is calculated, and then the pie chart is drawn.
The invention visualizes the user data, comprising the following steps:
(1) Coordinate information in the data, drawing all individuals on x-y coordinates;
(2) Re-drawing according to the mode of changing drawing by user operation;
(3) According to the operation of a user, highlighting the set of the clicked individuals during drawing;
(4) And calculating statistical information by the background according to the individual set clicked by the user, and drawing a statistical chart including a histogram and a pie chart, wherein the statistical chart is finally shown in fig. 7.
Based on the pointing of the operator unit, the user may select a subset of individuals, such as a sample, a group of samples, a category, a cable selection area, an individual with a measurement of some or several characteristics other than 0. After the individual subset is selected, the row where the corresponding individual is located can be decimated in the data to form the data of the individual subset, as follows:
data sheet for all individuals
Data sheet of individual subset after clicking on class II
Clicking down on the data of the selected subset of individuals may download a table of data of the subset of individuals.
According to the invention, the data is plotted according to the user operation, and the visualized statistical graph is generated, so that a user system can conveniently, intuitively and rapidly acquire information contained in a huge data matrix, and interaction with the user is realized.
While the preferred embodiment of the present application has been described in detail, the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present application, and the equivalent modifications or substitutions are included in the scope of the present application as defined in the appended claims.