A sample-based visualization generation method and system
By acquiring and templated chart examples from Vega or Vega-Lite, and combining them with user data mapping and editing, the limitations of existing visualization tools in terms of expressiveness and the complexity and time-consuming generation process are solved, enabling easy-to-use and rich visualization creation.
Patent Information
- Application Number
- CN202210515303.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-11
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-05-11
AI Technical Summary
Existing visualization tools have limitations in expressiveness and ease of use, and the generation process is complex and time-consuming. In particular, the declarative programmatic method requires high programming skills, making it difficult for users to generate the visualizations they envision.
By acquiring chart samples based on Vega or Vega-Lite, templates are created, and user data is mapped to the template to generate target visualization charts. Template editing and interactive editing are supported, and incremental, differentiated, and full refresh methods are provided.
It enhances the richness and ease of use of visualization creation, simplifies the generation process, reduces the requirements for programming skills, and enables the automatic generation of visualization charts that users want.
Smart Images

Figure CN115098088B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer visualization technology, and in particular to a method and system for generating visualizations based on examples. Background Technology
[0002] The widespread demand for visualization analytics has spurred a range of excellent visualization authoring tools in both industry and academia, such as Tableau and Microsoft Power BI in industry, and Vega-Lite, Data Illustrator, and Voyager in academia. These tools reduce the effort users need to put into creating visualizations.
[0003] Existing visualization technologies can be mainly categorized into: template editors, framework structures, interactive editing methods, and procedural methods. Existing visualization tools have limitations in both expressiveness and ease of use; specifically:
[0004] Template editors, such as Microsoft Excel and RAWGraphs, provide a set of templates for different chart types. To create a visualization, users only need to select a chart template and then modify the template configuration. Although the system is efficient, its expressiveness is limited by the available chart templates.
[0005] Shelf-like structures, such as Polariscite and Voyager, allow users to map data variables to visual encoding channels, such as axes, colors, sizes, and shapes, through interactive methods like selection or drag and drop. However, these tools lack control over the basic visualization layout.
[0006] Interactive editing methods, such as IVisDesigner and Lyra, are interactive systems that provide users with fine-grained control, allowing them to specify visual elements such as markers, channels, and layouts. While these systems are intuitive, their interfaces are often more complex than template editors and shelf constructions.
[0007] Programmatic approaches, including imperative languages (such as ProtoVis and D3) and declarative syntaxes (such as ggplot2 and Vega-Lite), support significant expressive plot design, but at the cost of complexity. Declarative approaches bring users closer to programming concepts and offer varying degrees of expressiveness; however, they require a high level of programming skill.
[0008] Among these tools, the declarative programmatic approach is a fundamental pattern widely used in the visualization community. Common declarative programmatic methods include Vega, Vega-Lite, ggplot2, and Atom. Compared to interactive systems, the declarative programmatic approach supports significantly expressive chart design and allows for low-level modifications.
[0009] However, for most developers, writing declarative text specifications remains a cumbersome and time-consuming process. On the one hand, this approach means that if a user wants to generate a visual creation they've already conceived of, they may not know where to begin; on the other hand, it requires users to be familiar with the syntax and write code line by line from scratch.
[0010] Therefore, the limitations of existing visualization techniques in terms of expressive power, which are restricted by existing templates, and the complex and time-consuming generation process, are important issues that urgently need to be addressed in the field of computer visualization technology. Summary of the Invention
[0011] This invention provides a sample-based visualization generation method and system to overcome the shortcomings of existing technologies where the expressiveness of visualization is limited by existing templates and the generation process is complex and time-consuming, effectively improving the richness and ease of use of visualization creation.
[0012] On one hand, the present invention provides a visualization generation method based on examples, including: obtaining chart examples based on Vega or Vega-Line; template the chart examples to obtain corresponding chart templates; obtaining actual user data, mapping the actual user data to the chart templates, and generating a target visualization chart.
[0013] Furthermore, the step of templating the chart sample to obtain a corresponding chart template includes: extracting the sample subject and sample object from the chart sample; and replacing the sample subject and sample object with mask data to obtain the chart template.
[0014] Furthermore, the step of mapping the actual user data to the chart template to generate a target visualization chart includes: obtaining the mask data and its corresponding mask data type in the chart template through recursive search; extracting target data from the actual user data according to the mask data type; and replacing the mask data in the chart template with the target data to obtain the target visualization chart.
[0015] Furthermore, the step of replacing the mask data in the chart template with the target data to obtain the target visualization chart further includes: refreshing the target visualization chart using a preset refresh method; the preset refresh method includes incremental refresh, differential refresh, and full refresh.
[0016] Furthermore, the generation of the target visualization chart also includes: interactively editing the chart template and the target visualization chart through a template editor and an extension editor.
[0017] Furthermore, the example-based visualization generation method also includes classifying the chart templates into commonly used chart templates, advanced chart templates, and personal chart templates.
[0018] Secondly, the present invention also provides a sample-based visualization generation system, comprising: a chart sample acquisition module for acquiring chart samples based on Vega or Vega-Line; a chart template acquisition module for template-izing the chart samples to obtain corresponding chart templates; and a visualization chart generation module for acquiring actual user data, mapping the actual user data to the chart template, and generating a target visualization chart.
[0019] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the example-based visualization method as described above.
[0020] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the example-based visualization method as described above.
[0021] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the example-based visualization method as described above.
[0022] The present invention provides a sample-based visualization generation method. By acquiring chart samples based on Vega or Vega-Line, which can be obtained from an existing complete sample library or from the internet according to the user's preferences, this method greatly enriches the sources of chart samples for visualization creation compared to existing technologies. The chart samples are templated to obtain corresponding chart templates. By mapping the acquired user's actual data to the chart templates, the desired target visualization chart can be automatically generated. This method overcomes the shortcomings of existing technologies where the expressiveness of visualization is limited by existing templates and the generation process is complex and time-consuming, effectively improving the richness and ease of use of visualization creation. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 A schematic flowchart illustrating the example-based visualization method provided by this invention;
[0025] Figure 2 This is a schematic diagram of the overall process of the example-based visualization method provided by the present invention;
[0026] Figure 3 A schematic diagram of the structure of the example-based visualization system provided by the present invention;
[0027] Figure 4 A schematic diagram of the user interface of the example-based visualization generation system provided by the present invention;
[0028] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0030] Understandably, in existing technologies, visual creation is mostly accomplished through template editors, framework structures, interactive editing methods, or procedural methods. However, these methods have limitations in terms of expressiveness and ease of use. Therefore, this invention takes chart examples as its starting point. Chart examples can come from the complete sample library that has been stored in the system, or they can be chart examples that users can obtain from the network through Vega or Vega-Line, which greatly enriches the sources of chart examples.
[0031] Furthermore, existing technologies either complete visualization creation based on existing templates or create visualization creation completely "from scratch," while the present invention completes visualization creation based on examples, and obtains the corresponding template after the example is templated. In other words, the present invention provides a visualization generation method based on examples.
[0032] Specifically, Figure 1A flowchart illustrating the example-based visualization generation method provided by this invention is shown. Figure 1 As shown, this example-based visualization generation method includes:
[0033] S101, Obtain a chart sample based on Vega or Vega-Line. In this step, a scheme programming language adapted to Vega and Vega-Line is designed, denoted as Vega-Link. Vega-Link complements Vega / Vega-Line.
[0034] Charts generally refer to graphical structures displayed on a screen that can intuitively show statistical information attributes, such as time and quantity. They play a key role in knowledge mining and providing a vivid and intuitive understanding of information. They are an excellent means of "visualization" to make object attribute data more intuitive and visual. Common charts include bar charts, column charts, line charts, and pie charts.
[0035] Vega is a declarative language for creating, saving, and sharing interactive visual designs. Vega uses JSON format to describe the visual appearance and interactive behavior of visualizations and generates web-based views using HTML5 Canvas or SVG (Scalable Vector Graphics).
[0036] Vega-Lite is a high-level visualization syntax. It supports concise JSON syntax for quickly generating visualizations to support analysis. Vega-Lite supports interactive multi-view graphs and can be compiled into Vega.
[0037] Vega-Link primitives can be divided into three categories:
[0038] (1) Basic Options: This option is related to the basic attributes of the chart, including author, name, type description and theme. The name is the unique identifier of the chart. The supported themes are the same as those supported by Vega / Vega-Lite, such as excel, vox, dark and googlecharts.
[0039] (2) Data Options: This section focuses on how to connect chart templates with user data, as well as refreshing data sources, including Data, Update, and Refresh.
[0040] (3) Position options: This option is related to the position information of the chart and is helpful for view transitions, including chart position, chart size, page size and margin.
[0041] Primitives typically consist of several instructions to perform a specific operation, and their function is achieved through an indivisible or uninterruptible program.
[0042] Understandably, the chart examples can be from a pre-prepared library of complete examples based on Vega and Vega-Line, or they can be any chart implemented using Vega or Vega-Line that the user obtains from the internet.
[0043] It should be noted that the chart examples in this embodiment are not limited to existing sample libraries; users can also use charts found online according to their preferences, greatly enriching the sources of chart examples for visualization creation. However, it is important to note that whether the charts are from the complete sample library or found online, the prerequisite for using them as chart examples is that these charts are implemented using Vega or Vega-Line.
[0044] It should also be noted that the chart examples in the complete sample library can be categorized according to actual needs or user preferences, making it easier for users to find the chart examples they want to use.
[0045] S102, template the chart sample to obtain the corresponding chart template.
[0046] It is understandable that, based on obtaining the chart sample based on Vega or Vega-Line in step S101, the chart sample is templated to obtain the corresponding chart template.
[0047] The process of templated chart examples is essentially an abstraction of the chart examples and a decoupling of the chart examples from the data within them. This involves generalizing the sub-concepts in the chart examples or replacing them with special characters. For example, if a chart example contains the sentence "Huahua loves blueberries," the corresponding sentence in the templated chart would be "So-and-so loves fruit" or "×× loves fruit."
[0048] It should be noted that, due to the diverse sources of chart examples, the chart templates obtained by templateting these examples are also extremely abundant.
[0049] Similarly, all chart templates can be categorized. In one specific embodiment, chart templates are divided into common chart templates, advanced chart templates, and personal chart templates. Common charts include 178 charts specified by Vega-Lite and have a relatively simple declarative syntax. Advanced charts include 89 charts specified by Vega, which are relatively complex but more feature-rich. Personal charts are charts customized by the user.
[0050] The presentation catalog of commonly used and advanced charts in the chart template is consistent with the presentation catalog of chart samples categorized in the complete sample library mentioned above, making it easier for users to find the chart template they want.
[0051] S103: Obtain actual user data, map the actual user data to the chart template, and generate the target visualization chart.
[0052] Understandably, based on the corresponding chart template obtained in step S102, the data that the user actually needs to use is mapped into the chart template, that is, the user's actual data is embedded into the corresponding position in the chart template, and then the system will automatically generate the target visualization chart.
[0053] In this embodiment, chart examples based on Vega or Vega-Line are obtained. These examples can be acquired from an existing complete sample library or obtained online according to the user's preferences. This greatly enriches the sources of chart examples for visualization creation compared to existing technologies. By templatedizing these chart examples, corresponding chart templates are obtained. The acquired actual user data is mapped to the chart templates, thus automatically generating the target visualization chart desired by the user. This method overcomes the shortcomings of existing technologies where the expressiveness of visualization is limited by existing templates and the generation process is complex and time-consuming, effectively improving the richness and ease of use of visualization creation.
[0054] Based on the above embodiments, the chart examples are further templated to obtain corresponding chart templates, including:
[0055] Extract the sample subject and sample object from the chart sample;
[0056] Replace the sample subject and sample object with mask data to obtain the chart template.
[0057] Understandably, the chart sample is templated to obtain the corresponding chart template. Specifically, the subject and object of the sample are extracted and replaced with mask data to obtain the chart template. The subject refers to the person in the chart sample, and the object is the thing the subject refers to. There may be one or more subject and object. The mask data can be general terms or specific characters. General terms can be specific categories of things, and specific characters can be such as "×××" or "***".
[0058] It should be noted that the data in the chart examples contains many individual data points, such as the sample subject and sample object mentioned above. These will generally change for different users, so they need to be abstracted in order to better embed the actual user data into the chart template.
[0059] In this embodiment, the sample subject and sample object are extracted from the chart sample and replaced with mask data to obtain the chart template, thereby realizing the templateization of the chart sample. This allows the user's actual data to be better mapped into the chart template, thus automatically and efficiently generating the target visualization chart.
[0060] Based on the above embodiments, further, the actual user data is mapped to the chart template to generate the target visualization chart, including:
[0061] By recursively searching, the mask data and its corresponding mask data type in the chart template are obtained; based on the mask data type, the target data is extracted from the user's actual data; the target data is used to replace the mask data in the chart template to obtain the target visualization chart.
[0062] Understandably, the process involves mapping actual user data onto a chart template to generate the target visualization chart. Specifically, based on a sample chart template, a recursive search is used to retrieve the mask data and its corresponding data type from the chart template. Based on the mask data type, target data matching the mask data type is extracted from the actual user data. This target data replaces the mask data in the chart template, thus obtaining the target visualization chart. Common recursive search methods include depth-first search, memoization search, and dynamic programming.
[0063] Data type is an important feature of visual creation. In this embodiment, the mask data types include categorical variables, ordinal variables, numeric variables, and time-series variables. Categorical variables are variables that are classified according to attributes, such as male and female attributes. Ordinal variables are variables that are classified according to a certain order or level, such as "like," "love," "indifferent," and "dislike." Numerical variables have a quantitative value, which is expressed as a numerical value, and are a point value. Time-series variables are variables that are arranged in chronological order.
[0064] It's important to note that when a user's actual data does not contain a data variable with the same data type as the mask in the chart template, the system will automatically select a variable of a similar type. For example, in one specific implementation, the mask data type in the chart template is a categorical variable, but the user's actual data does not contain a corresponding variable. In this case, the system continues to search for ordinal variables. If none of these are found, it searches for numerical variables, and if still none, it searches for time-series variables, until the corresponding data is found.
[0065] It should also be noted that the target visualization charts obtained based on the user's actual data can be stored in the complete sample library for direct use by the user next time. Furthermore, multiple target visualization charts can be obtained using the above method, and their layouts and adjustments can be made accordingly to create the corresponding dashboards.
[0066] In this embodiment, the mask data and corresponding mask data type in the chart template are obtained through recursive search. Based on the mask data type, the target data that is consistent with the mask data type is extracted from the user's actual data. Furthermore, the mask data in the chart template is replaced with the target data to obtain the target visualization chart. Based on the chart sample template, the instantiation of the chart template is realized. The template and instantiation processes are fully automated, which greatly improves the generation efficiency of visualization creation.
[0067] Based on the above embodiments, further, the mask data in the chart template is replaced with the target data to obtain the target visualization chart, and then the process includes:
[0068] Refresh the target visualization chart using preset refresh methods; preset refresh methods include incremental refresh, differential refresh, and full refresh.
[0069] Understandably, after obtaining the target visualization chart, the target visualization chart is refreshed using a preset refresh method. The preset refresh methods include three types: incremental refresh, differential refresh, and full refresh.
[0070] Incremental refresh means that when a user refreshes at a certain moment, the refresh only retrieves data from that moment onwards. Differential refresh means that when a user refreshes at a certain moment, in addition to retrieving data from that moment onwards, it also retrieves data from before that moment that should have been received but was not received due to network latency or other reasons. Full refresh means that when a user refreshes at a certain moment, regardless of whether all data from before that moment has been received, it will retrieve all data, including data from both before and after that moment.
[0071] It should be noted that the refresh model can include fixed-time refresh or fixed-interval refresh. Fixed-time refresh means refreshing at one or more fixed time points, while fixed-interval refresh means refreshing once at preset time intervals.
[0072] It should also be noted that the refresh mode and preset refresh method mentioned in this embodiment are applicable to a dashboard composed of multiple target visualization charts, and the entire dashboard or a specific visualization chart in the dashboard can be refreshed.
[0073] In this embodiment, the target visualization chart is refreshed using preset refresh methods, including incremental refresh, differential refresh, and full refresh, which can more comprehensively display the current information in the target visualization chart.
[0074] Based on the above embodiments, after generating the target visualization chart, the visualization generation method further includes: interactively editing the chart template and the target visualization chart through a template editor and an extended editor.
[0075] The interactive editing provided in this embodiment involves a template editor and an extension editor. Specifically, the template editor and the extension editor are used to interactively edit chart templates and target visualization charts.
[0076] The template editor offers three editing modes: Options, Extended, and Custom. The Options configuration mode allows for quick editing at the option level, which is user-friendly for beginners. Autofill and alert mechanisms help users complete input efficiently. Autofill displays a dropdown list suggesting candidate words when the user enters an incomplete character, improving the user experience. The alert mechanism provides error messages and correct input instructions when the user enters an invalid character.
[0077] The parameter extension mode expands the option configuration mode, supporting the addition and deletion of parameters. Users can add parameters in various ways by clicking the add box on the left.
[0078] The free configuration mode allows users to freely modify or even rewrite the specifications, and can be used to import open source charts as personal chart templates.
[0079] Understandably, after a user selects a chart example, a chart template is generated through templating. At this point, the chart template's code is automatically loaded into the template editor. The template editor supports modular editing and auto-fill, where modular editing refers to editing a specific section of the chart template's code. The extended editor, driven by Vega-Link, allows editing the global attribute information of the chart template and the target visualization, such as the data source, data refresh strategy, and chart position.
[0080] It should be noted that the personal chart templates mentioned above can be created through interactive editing.
[0081] In this embodiment, the template editor and the extended editor allow for interactive editing of chart templates and target visualization charts. The interactive chart editing code is displayed on the creation canvas in real time, providing a WYSIWYG editing experience. At the same time, users can gain inspiration while browsing the design and adapt it into their own visualization creations.
[0082] in addition, Figure 2 The diagram illustrates the overall process of the example-based visualization generation method provided by this invention, further clarifying... Figure 1 Steps S101-S103 in the example. Figure 2 As shown, firstly, chart samples are obtained from a complete sample library based on Vega or Vega-Line. Vega-Link (a scheme programming language adapted to Vega and Vega-Line) is used to decouple the data from the chart samples to obtain the corresponding chart templates. Then, the actual user data is obtained and mapped into the chart templates to obtain the target visualization charts. Finally, based on view transformation, multiple target visualization charts are adjusted and laid out to obtain a dashboard.
[0083] This process also involves interactive editing, allowing users to edit the chart template after obtaining it to create a personalized chart. Once the target visualization is generated, its position and size can be edited.
[0084] Figure 3 A schematic diagram of the sample-based visualization generation system provided by this invention is shown. For example... Figure 3As shown, the sample-based visualization generation system includes: a chart sample acquisition module 301, used to acquire chart samples based on Vega or Vega-Line; a chart template acquisition module 302, used to template the chart samples to obtain the corresponding chart templates; and a visualization chart generation module 303, used to acquire actual user data, map the actual user data to the chart templates, and generate the target visualization chart.
[0085] The example-based visualization generation system provided by this invention can be referred to in correspondence with the example-based visualization generation method described above, and will not be repeated here.
[0086] In this embodiment, the chart example acquisition module 301 acquires chart examples based on Vega or Vega-Line. These chart examples can be obtained from an existing complete example library or from the internet according to the user's preferences, greatly enriching the sources of chart examples for visualization creation compared to existing technologies. The chart template acquisition module 302 templates the chart examples to obtain corresponding chart templates. The visualization chart generation module 303 maps the acquired user's actual data to the chart templates, thereby automatically generating the target visualization chart desired by the user. This system overcomes the shortcomings of existing technologies where the expressiveness of visualization is limited by existing templates and the generation process is complex and time-consuming, effectively improving the richness and ease of use of visualization creation.
[0087] in addition, Figure 4 A schematic diagram of the user interface of the example-based visualization generation system provided by the present invention is shown, detailing... Figure 3 The system creates a visual creation interface. For example... Figure 4 As shown, the rightmost section is the editing panel, adjacent to which is the visualization area, i.e., the chart display area. Its size is adjustable. The editing panel and the visualization area are displayed on the same plane, allowing users to easily see the editing effects and make corresponding adjustments. The leftmost section contains the data items, including chart sample data, chart template data, and the user's actual data. The bottom section is the chart template area, used to display all chart templates. Figure 4 It can also be seen that, in practice, all chart templates can be divided into three categories: Personal, Common, and Advanced, to make it easier for users to find the chart template they want. Of course, all templates can also be categorized according to user preferences.
[0088] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5As shown, the electronic device may include a processor 510, a communication interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a sample-based visualization generation method, which includes: obtaining a chart sample based on Vega or Vega-Line; template the chart sample to obtain a corresponding chart template; obtaining actual user data; mapping the actual user data to the chart template; and generating a target visualization chart.
[0089] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0090] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the example-based visualization generation method provided by the above methods. The method includes: obtaining a chart example based on Vega or Vega-Line; template the chart example to obtain a corresponding chart template; obtaining actual user data; mapping the actual user data to the chart template; and generating a target visualization chart.
[0091] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program is implemented to perform the example-based visualization generation method provided by the above methods. The method includes: obtaining a chart example based on Vega or Vega-Line; templating the chart example to obtain a corresponding chart template; obtaining actual user data; mapping the actual user data to the chart template; and generating a target visualization chart.
[0092] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A sample-based visualization generation method, characterized in that, include: Obtain chart examples based on Vega or Vega-Line; the chart examples are charts from a pre-stored complete sample library based on Vega and Vega-Line, or charts implemented using Vega or Vega-Line that the user can obtain arbitrarily from the network; The process of templating the chart example to obtain a corresponding chart template includes: extracting the example subject and example object from the chart example; and replacing the example subject and example object with mask data to obtain the chart template. Obtaining actual user data and mapping it to the chart template to generate a target visualization chart includes: recursively searching to obtain the mask data and its corresponding mask data type in the chart template; extracting target data from the actual user data according to the mask data type; and replacing the mask data in the chart template with the target data to obtain the target visualization chart.
2. The example-based visualization method according to claim 1, characterized in that, The process of replacing the mask data in the chart template with the target data to obtain the target visualization chart further includes: The target visualization chart is refreshed using a preset refresh method; the preset refresh method includes incremental refresh, differential refresh, and full refresh.
3. The example-based visualization method according to claim 1, characterized in that, The process of generating the target visualization chart then includes: The chart template and the target visualization chart can be interactively edited using the template editor and the extended editor.
4. The example-based visualization method according to claim 1, characterized in that, Also includes: The chart templates are categorized into commonly used chart templates, advanced chart templates, and personal chart templates.
5. A sample-based visualization generation system, characterized in that, include: The chart sample acquisition module is used to acquire chart samples based on Vega or Vega-Line; the chart samples are charts from a pre-stored complete sample library based on Vega and Vega-Line, or charts implemented by Vega or Vega-Line that the user can obtain arbitrarily from the Internet. The chart template acquisition module is used to template the chart sample to obtain the corresponding chart template, including: extracting the sample body and sample object from the chart sample; replacing the sample body and sample object with mask data to obtain the chart template; A visualization chart generation module is used to acquire actual user data, map the actual user data to the chart template, and generate a target visualization chart. This includes: recursively searching to obtain the mask data and its corresponding mask data type in the chart template; extracting target data from the actual user data based on the mask data type; and replacing the mask data in the chart template with the target data to obtain the target visualization chart.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the example-based visualization generation method as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the example-based visualization generation method as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the example-based visualization generation method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Data visualization method and device, electronic equipment and readable storage medium
CN112182074A
Creation, sharing and embedding of interactive charts
US20100005008A1