Toggle navigation
Home
▼ Details
Products and pricing
Chart gallery
User stories
Text analytics
CDC NAMCS Library
Blog
Tutorials
Contact
Sign in
Post Editor
← All help posts
View post
Save
<img src="/uploads/upload/image/5200/direct/1560919434151-1560919434151.jpeg" alt="Wooden rubber stamp showing the word 'original' on the stamp face, with red text 'duplicated' stamped below it, illustrating the concept of copying and cloning" class="fr-fic fr-dii"> Sometimes you want to see different visualizations of the same column. You might want to see the data with different chart types, create a segmentation variable or just save a particular crosstab of interest. This tutorial shows how to clone and modify elements to create multiple views. ## Example 1 Let's say your survey has a data column **state**. By default Protobi shows each data column as an interactive bar chart, so state will initially appear like this: You can modify this element however you want -- choose a new chart type, translate or recode values, etc. But maybe you want to keep the original view and also create a modified view too. This is where cloning is useful. To create an independent copy of an element, select the element. Press the "Advanced" button in the toolbar and select "Clone (simple)": It will prompt you to enter a key for the new element. In this example enter "state\_cloud". You now have two different elements pointing at the same data column: You can change the new element without affecting the first. Press the blue edit icon, and from the context menu choose "Chart type..." and select "Word cloud" <img src="blob:https://protobi.helpjuice.com/6a0b6d42-826c-4ca7-a3b7-96ea5e265377" class="fr-fic fr-dii"> ## Clone vs copy-by-reference There are two ways to copy views in Protobi: - [**Copy by reference**](#copy-by-reference) - The same element appears in multiple groups - [**Clone**](#clone) Create a differnet element that refers to the same data column Each interactive chart in Protobi is called an "Element". Each element is defined by an attribute `key`. When Protobi creates an initial element for each data column, its key is the same as the data column name. In this example the initial element is **state**. ### Copy by reference Multiple groups can refer to the same key as a child element and that element will appear in each group. You can do this by dragging an element from one group to another and hold the Shift key when you drop. When copying by reference, changing the element in one place will change it everywhere. ### Clone In the example above we created an new element with a different key **state\_cloud**. Because it has a different key we can change its properties without affecting the first element. The new element has an attribute `field` with value "state" so it draws its data from column "state". You can verify this by selecting "More properties..." from the context menu. ## How cloning works underneath When you clone an element, you get a new element with a new key. Below is the JSON configuration for the new element: Here we can see that it has a new key. And it also specifies a new attribute `"field": "state"` which tells the element to get its data from the same data column as the original element. The attribute `"format"` is also copied over, as in this survey states are represented in the data as integer codes and value labels for display are specified in the format. In the view above that is minimized for brevity. ## Cloning groups: simple or recursive clones In the above example we cloned a simple element **state** that had no children. Sometimes you may wish to create multiple views of a group. The question then is whether to copy just the parent group (aka a "simple" clone) or recursively copy its child elements (aka a "recursive" clone). For instance, we might have a group **q15** that shows ratings as a stacked bar chart: <img src="blob:https://protobi.helpjuice.com/25c8753b-bc16-4bb3-ba19-b23f2231b0d3" class="fr-fic fr-dii"> We might wish to clone the element and see it as a tornado chart as well: <img src="blob:https://protobi.helpjuice.com/f13b1bdd-ba4a-4be4-84bd-5664acb8bb88" class="fr-fic fr-dii"> If we create a simple clone, both parent groups will refer to the same children by reference. So if we change the titles or formats for a child element in one group it will change it in both. Generally this will be what you want. ### Recursively clone But if you want to create truly independent graphs, you can select "Clone (recursive)" and it will clone not just the parent group but its children all way down. In this case, rather than specify a new key for the clone element, you specify a prefix that will be prepended to each element's key to generate new keys. ### Or set heritability on the simple cloned group Generally simple cloning is appropriate for most cases where you need to create a new view. But keep in mind that some changes to a group element propagate down to its children. This includes changing color, format, recodes, filters and crosstab columns. You may not want changes to the new copy to propagate down to the child elements. When cloning a group element, consider setting the new copy so that its changes do not propagate down to its children. To do this press the edit icon, select "More properties..." and set "Heritable" to "No". <img src="blob:https://protobi.helpjuice.com/44448a91-1793-4dca-a017-1a450208f8ed" class="fr-fic fr-dii"> ## Video tutorial
Publishing
Date
Status
Published
Draft
Slug
edit
Content
Thumbnail
Categories
Manage
New to Protobi?
Charts
Making Changes
Intermediate topics for editors
Frequently Asked Questions
SERMO Topics
Tutorial Pages
Internal Docs
Data Processing
Videos
Obsolete
GSG Admin
SERMO Admin
GSG Topics
How to...
Basics for viewers
Basics for editors
For project admins
Advanced topics
Assessments
Articles (in-progress)
New and updated articles
Process data in Protobi
superseded
Text open-end questions
Troubleshooting
Tracking studies
Organizing the view
API References
Tools
AI Database
Checking AI...
Convert to MD
Danger zone
Delete