Toggle navigation
Home
▼ Details
Products and pricing
Chart gallery
User stories
Text analytics
CDC NAMCS Library
Blog
Tutorials
Contact
Sign in
Post Editor
← All blog posts
View post
Save
<p><script src="/javascripts/marked.js"></script></p> <p><script src="/javascripts/highlight.pack.js"></script></p> <link rel="stylesheet" href="/stylesheets/highlight-github.css"/> <p>Create Wordle-style word clouds in Protobi for text verbatims <img src="/images/blog/2018-02-11-word-cloud/verbatim-word-cloud.png" style="width:400px; text-align: center; display:block"/> <!--more--></p> <h2 id="example">Example</h2> <p>Let's say your study asked respondents to provide text answers to an open ended question:</p> <p><img src="/images/blog/2018-02-11-word-cloud/verbatim-distribution.png" style="width:400px; text-align: center; display:block; margin: 0 auto; "/></p> <h2 id="create-a-wordcloud">Create a WordCloud</h2> <p>To turn this into a word cloud press the circle edit icon to bring up the context menu and select "More properties...". Under "Chart type" select "Word cloud". This will create a simple cloud showing all verbatim answers:</p> <p> <img src="/images/blog/2018-02-11-word-cloud/verbatim-word-cloud-raw.png" style="width:400px; text-align: center; display:block; margin: 0 auto; "/></p> <p>By default. this shows the frequency of each answer, with font size equal to the percentage frequency. The fonts are small because each answer is unique and represents a tiny percentage of the sample.</p> <p>Typically though this is not so interesting as each response is unique.</p> <h2 id="split-phrases-into-words">Split phrases into words</h2> <p>To show frequencies of individual words rather than complete responses, select "Edit properties..." again and under "Split" type a space.</p> <p>This will now split strings at each space into multiple response variables, and thus show frequencies of each word:</p> <p> <img src="/images/blog/2018-02-11-word-cloud/verbatim-word-cloud-default.png" style="width:400px; text-align: center; display:block; margin: 0 auto; "/></p> <p>In this case the the font size still too small. This is because Protobi shows the font size equal to the percentage frequency by default. To adjust this, we can edit the detailed options.</p> <h2 id="chart-options">Chart options</h2> <p>Select "Edit JSON..." from the context menu. </p> <p> <img src="/images/blog/2018-02-11-word-cloud/verbatim-word-cloud-json.png" style="width:400px; text-align: center; display:block; margin: 0 auto; border: 1px solid grey "/></p> <p>Under <code>chartOptions</code> are the available options. E.g. set <code>scaleFontToMaxValue: "true"</code> and the fonts will be scaled such that the largest item is equal to <code>maxFontSize</code>.</p> <p><img src="/images/blog/2018-02-11-word-cloud/verbatim-word-cloud.png" style="width:400px; text-align: center; display:block"/></p> <p>Available options are:</p> <ul> <li><code>minFontSize</code>: <code>5</code> minimum font size to draw on the canvas. </li> <li><code>maxFontSize</code>: <code>60</code> maximum font size to draw on the canvas. Font sizes are calculated as a percent of this value.</li> <li><code>scaleToMaxFontSize</code>: <code>true</code> whether to scale</li> <li><p><code>limit</code> : <code>60</code> maximum number of values to draw </p> </li> <li><p><code>fontFamily</code>: font to use.</p> </li> <li><code>fontWeight</code>: <code>"normal"</code> font weight to use, e.g. <code>normal</code>, <code>bold</code> or <code>600</code></li> <li><p><code>color</code>: color of the text, can be any CSS color</p> </li> <li><p><code>weightFactor</code>: number to multiply <code>size</code> of each word</p> </li> <li><code>backgroundColor</code>: color of the background.</li> <li><p><code>drawOutOfBound</code>: <code>true</code> allows words bigger than the size of the canvas to be drawn.</p> </li> <li><p><code>shape</code>: <code>"ellipse"</code> The shape of the "cloud" to draw, <code>"circle"</code> (default), <code>"cardioid"</code>, <code>"diamond"</code>, <code>"square"</code>, <code>"triangle"</code>,and <code>"star"</code>.</p> </li> <li><code>ellipticity</code>: [ degree of "flatness" of the word cloud shape.</li> <li><code>shuffle</code>: <code>true</code> (default) randomizes points </li> <li><code>rotateRatio</code>: Probability for word to rotate. 1=always, 0=never.</li> </ul>
Date
Status
Published
Draft
Slug
edit
Thumbnail
Categories
Manage
Release
Features
Datasets
Surveys
Tips
NAMCS
Applications
Crosstab
Tutorial
Design
Concepts
Segmentation
Examples
Blog Test Category
Delete
Convert to MD