{"info":{"_postman_id":"0aa580b0-3a90-4ef4-ac47-8fd6b3673113","name":"Data visualization","description":"<html><head></head><body><h1 id=\"get-started-here\">📊 Get started here</h1>\n<p>The <a href=\"https://learning.postman.com/docs/sending-requests/visualizer/#:~:text=as%20an%20object.-,Viewing%20visualizations,be%20in%20a%20web%20browser.\">Postman Visualizer</a> provides a programmable way to represent responses visually.</p>\n<p>This collection contains six sample requests and scripts for rendering Bar graph, Table, Map and visualizing any CSV, JSON or XML data.</p>\n<h2 id=\"🔖-how-to-use-this-template\">🔖 <strong>How to use this template</strong></h2>\n<p><strong>Step 1:</strong> Send the requests.</p>\n<p><strong>Step 2:</strong> Find the visualization in the \"Visualize\" tab in the response near the \"Pretty\" view.</p>\n<p><strong>Step 3:</strong> You can copy, update and use the test script under the \"Scripts\" tab for your requests.</p>\n<img src=\"https://content.pstmn.io/59d809d6-5f6a-4e78-814c-6dfed5ee2966/aW1hZ2UucG5n\" width=\"2164\" height=\"1486\">\n\n<h2 id=\"💡related-templates\">💡Related templates</h2>\n<p><a href=\"https://go.postman.co/redirect/workspace?type=personal&amp;collectionTemplateId=e9a37a28-055b-49cd-8c7e-97494a21eb54&amp;sourceTemplateId=c9e72d75-ded7-4135-a721-5d59ddda6d59\">API testing basics</a><br><a href=\"https://go.postman.co/redirect/workspace?type=personal&amp;collectionTemplateId=173eff9a-3c69-4560-8205-cbbe9e050baa&amp;sourceTemplateId=c9e72d75-ded7-4135-a721-5d59ddda6d59\">Using libraries</a><br><a href=\"https://go.postman.co/redirect/workspace?type=personal&amp;collectionTemplateId=e9c28f47-1253-44af-a2f3-20dce4da1f18&amp;sourceTemplateId=c9e72d75-ded7-4135-a721-5d59ddda6d59\">API documentation</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"📊 Get started here","slug":"get-started-here"}],"owner":"38456876","collectionId":"0aa580b0-3a90-4ef4-ac47-8fd6b3673113","publishedId":"2sB3Wqug5N","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-11-05T15:27:41.000Z"},"item":[{"name":"Visualize bar chart","event":[{"listen":"test","script":{"exec":["// Define a handlebars template which will receive the response data and be used to render the visualization","var template = `","// Create a canvas to draw the chart into","<canvas id=\"myChart\"  height=\"150\"></canvas>","","// Import Chart.js library which we'll use to define and draw the chart","<script src=\"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js\"></script> ","","<script>","var ctx = document.getElementById(\"myChart\");","","// Define the chart axes and appearance using Chart.js","var myChart = new Chart(ctx, {","  type: \"bar\",","  data: {","    labels: [\"City A\", \"City B\", \"City C\", \"City D\"],","    datasets: [","      {","        label: \"\",","        data: [0,0,0,0],","        backgroundColor: [\"#3e95cd\", \"#8e5ea2\", \"#3cba9f\", \"#e8c3b9\", \"#c45850\"],","        backgroundColor: [\"#3e95cd\", \"#8e5ea2\", \"#3cba9f\", \"#e8c3b9\", \"#c45850\"],","      },","    ],","  },","  options: {","    legend: { display: false },","    title: {","      display: true,","      text: \"Population density(per square km)\",","    },","    scales: {","      xAxes: [","        {","          display: true,","          scaleLabel: {","            display: true,","            labelString: \"Cities\",","          },","        },","      ],","      yAxes: [","        {","          display: true,","          scaleLabel: {","            display: true,","            labelString: \"Density\",","          },","        },","      ],","    },","  },","});","","// Get the data passed to the template and apply it to the chart we defined","pm.getData(function (err, value) {","  myChart.data.datasets[0].data = value.res;","  myChart.update();","});","</script>`;","","var response = pm.response.json();","","// Pass our template and response data to the Postman visualizer to render it in the \"Visualize\" view","pm.visualizer.set(template, {","    res: response.data.content","} );"],"type":"text/javascript","packages":{}}}],"id":"6c3a8562-6f8b-45f7-bf7f-b6fab7b0dd97","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"message\": \"Go to Visualize tab on the right 👉 located alongside the Pretty, Raw, and Preview options. We have added the visualization code to the Scripts tab in the request.\",\n\t\"content\":\n\t[\n\t 795,\n\t 49,\n\t 231,\n\t 942\n\t\t\n\t]\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-echo.com/post","description":"<p>This request helps you visualize the response body as a bar chart.</p>\n<p>The same bar chart represents (imaginary) population densities for some cities. The data for the bar chart includes random numbers between 0-1000 taken from the response.</p>\n<p>To visualize your response as a bar chart, replace the sample request URL with your API. Or you can copy the test script from the “Scripts” tab and reuse it.</p>\n<p>You can also tweak the scripts to change to a line or pie chart.</p>\n","urlObject":{"protocol":"https","path":["post"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"6c3a8562-6f8b-45f7-bf7f-b6fab7b0dd97"},{"name":"Visualize table","event":[{"listen":"test","script":{"exec":["// Define a handlebars template which renders the response data in a table","// We define a table and use handlebars `{{#each}}` syntax to map over the response data","// We can include custom CSS to style the table","var template = `","<style type=\"text/css\">","    table {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse; box-sizing: border-box;}","    th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px !important;border-style: solid;border-color: #87ceeb;text-align:left;}","    tr {background-color:#ffffff;}","    td {font-size:14px;border-width: 1px;padding: 8px !important;border-style: solid;border-color: #87ceeb;}","    tr:hover {background-color:#e0ffff;}","</style>","    ","<table border=\"1\">","    <tr>","        <th>Name</th>","        <th>Email</th>","    </tr>","    ","    {{#each response.data.contacts}}","        <tr>","            <td>{{name}}</td>","            <td>{{email}}</td>","        </tr>","    {{/each}}","</table>","`;","","// Pass our template and response data to the Postman visualizer to render it in the \"Visualize\" view","pm.visualizer.set(template, {","    response: JSON.parse(responseBody)","});"],"type":"text/javascript","packages":{}}}],"id":"08ba9bef-9a48-4ccc-9948-9303904313e5","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n   \"message\": \"Go to Visualize tab on the right 👉 located alongside the Pretty, Raw, and Preview options. We have added the visualization code to the Scripts tab in the request.\",\n\t\"contacts\": [\n\t\t{\n\t\t\t\"name\": \"Ernesto Goodwin\",\n\t\t\t\"email\": \"Braxton.Crona@hotmail.com\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Kay Koepp V\",\n\t\t\t\"email\": \"Angela_Marquardt@yahoo.com\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Colleen Jerde\",\n\t\t\t\"email\": \"Jude.Kassulke5@hotmail.com\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Edna Hermiston\",\n\t\t\t\"email\": \"Beth.Labadie@hotmail.com\"\n\t\t}\n\t\t]\n}\n\t\t","options":{"raw":{"language":"json"}}},"url":"https://postman-echo.com/post","description":"<p>This request visualizes the response body as a table. The data for the table includes randomly generated names and e-mails from postman-echo.</p>\n<p>To visualize your response as a table, replace the sample request URL with your API. Or you can copy the test script from the “Scripts” tab and reuse it.</p>\n","urlObject":{"protocol":"https","path":["post"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"08ba9bef-9a48-4ccc-9948-9303904313e5"},{"name":"Visualize map","event":[{"listen":"prerequest","script":{"exec":["const now = new Date()","","","const nDaysDiff = (baseDateStr, nDays) => {","    const baseDate = new Date(baseDateStr)","    const baseDateMilli = baseDate.getTime()","    const offsetMilli = 1000 * 60 * 60 * 24 * nDays ","    const offsetDate = new Date(baseDateMilli + offsetMilli)","    const offsetDateStr = offsetDate.toISOString().split(\"T\")[0]","    return offsetDateStr","}","","const startTime = nDaysDiff(now.toString(), -3)","const endTime = now.toISOString().split(\"T\")[0]","","pm.collectionVariables.set('eq-starttime', startTime)","pm.collectionVariables.set('eq-endtime', endTime)"],"type":"text/javascript"}},{"listen":"test","script":{"exec":["var template = `","<script src=\"https://d3js.org/d3.v5.min.js\"></script>","<script src=\"https://unpkg.com/topojson@3\"></script>","<style>","body { ","    background-color: white;","}",".title { ","    font-size: 30px;","    font-family: \"Roboto\", sans-serif;","    text-align: center;","}",".container {","    display: flex;","    flex-direction: row;","    justify-content: center;","    align-items: center;","}",".directions {","    font-size: 18px;","    font-family: \"Roboto\", sans-serif;","    padding-left: 20px;","}","#backgroundRectangle {","    width: 100%;","    height: 100%;","    fill: #f5f5f5;","}",".projectionOutline{","    fill: #2f434a;","    stroke: #4e5f66","}",".tooltip {","    position: absolute;","    font-size: 12px;","    width: auto;","    height: auto;","    pointer-events: none;","    background-color: white;","    padding: 3px;","}","","</style>","<h1 class=\"title\"></h1>","<div class=\"container\">","<div id=\"map\"></div>","<p class=\"directions\">Draw mouse to zoom in onto section. Double click to zoom out</p>","</div>","<script>","","    pm.getData( function(err, value) {","        d3.select(\".title\").html(value.title);","        initVisualization(value.data);","    });","","    // Function call that contains our visualization, necessary because we are loading an external map file","    async function initVisualization(pmInput){","        const response = await fetch(\"https://unpkg.com/world-atlas@1.1.4/world/110m.json\");","        response.json().then( data => {","            generateVisualization(pmInput, data);","        });","    }","    ","    // Generates d3 map visualization using an external map file and user-inputed data","    // Utilizes d3.zoom and d3.brush","    function generateVisualization(pmInput, mapData){","        // Set the dimensions and margins of the graph","        const margins = {top: 20, left: 10, right: 20, bottom: 20};","        const width = 800 - margins.top - margins.bottom;","        const height = 500 - margins.left - margins.right;","        ","        // Initializes d3.zoom to cover entire map SVG","        const zoom = d3.zoom()","            .scaleExtent([1,40])","            .translateExtent([[0,0],[width + margins.left + margins.right, height + margins.top + margins.bottom]])","            .extent([[0,0],[width + margins.left + margins.right, height + margins.top + margins.bottom]])","            .on(\"zoom\", () =>{","                d3.select(\"#map-group\").attr(\"transform\", d3.event.transform)","            })","        ","        // Initiaizes d3.brush to cover entire map SVG and zoom in on the selected window","        let brush = d3.brush()","            .extent([[0,0],[width + margins.left + margins.right, height + margins.top + margins.bottom]])","            .on(\"end\", () => {","                let extent = d3.event.selection;","                if(extent){","                    d3.select(\"#map-group\").call(brush.move, null);","                    d3.select(\"#map-group\").transition().duration(1500).call(zoom.transform, d3.zoomIdentity","                        .scale( (width + margins.left + margins.right)/ (extent[1][0]-extent[0][0]) )","                        .translate( -extent[0][0], -extent[0][1] ));","                    d3.selectAll(\"circle\").transition().delay(750).duration(1000)","                        .attr(\"r\", d => { return 2 * d.circleSize * (extent[1][0]-extent[0][0])/(width + margins.left + margins.right);} )","                        .attr(\"stroke-width\", (extent[1][0]-extent[0][0])/(width + margins.left + margins.right));","                    ","                }","                else{","                    d3.select(\"#map-group\").transition().duration(1500).call(zoom.transform, d3.zoomIdentity","                        .scale( 1 )","                        .translate( 0,0 ));","                    d3.selectAll(\"circle\").transition().delay(750).duration(1000)","                        .attr(\"r\", d => d.circleSize)","                        .attr(\"stroke-width\", 1);","                }","            });","        ","        // Set the dimensions and margins of the graph","        let svg = d3.select(\"#map\")","          .append(\"svg\")  ","            .attr(\"width\", width + margins.left + margins.right)","            .attr(\"height\", height + margins.top + margins.bottom)","        svg.append(\"rect\")","            .attr(\"id\", \"backgroundRectangle\");","        svg = svg.append(\"g\")","            .attr(\"id\", \"map-group\")","            .call(brush);","        ","        // Draws Mercator projection of map onto SVG using the inputted map file","        let projection = d3.geoMercator().translate([400, 350]).scale(125);","        var mapGroup = svg.append(\"g\");","        let mapPath = d3.geoPath().projection(projection);","        mapGroup.selectAll(\"path\")","            .data(topojson.feature(mapData, mapData.objects.countries).features)","            .enter()","          .append(\"path\")","            .attr(\"d\", mapPath)","            .attr(\"class\", \"projectionOutline\");","        ","        // Calculate offset for tooltip","        const rect = document.getElementById(\"map\").getBoundingClientRect();","        const offset = {top: rect.top, left: rect.left};","        ","        // Create hover tooltip","        let tooltip = d3.select(\"#map\").append(\"div\")","            .attr(\"class\", \"tooltip\");","        // tooltip mouseover event handler","        let tipMouseover = function(d){","            tooltip.html(\"Longitude: <b>\" + d.long + \"</b><br/>Latitude: <b>\" + d.lat + \"</b>\")","                .style(\"left\", (d3.event.pageX + 15 - offset.left) + \"px\")","                .style(\"top\", (d3.event.pageY - 20 - offset.top) + \"px\")","              .transition()","                .duration(200)      // ms","                .style(\"opacity\", 0.9)","            d3.select(this)","                .style(\"stroke\", \"white\")","                .style(\"opacity\", 1);","        };","        // tooltip mouseout event handler","        let tipMouseout = function(d){","            tooltip.transition()","                .duration(300)","                .style(\"opacity\", 0);","            d3.select(this)","                .style(\"stroke\", \"none\")","                .style(\"opacity\", 0.6);","        };","        ","        // Appends points from user-inputted data onto map","        svg.selectAll(\"circle\")","            .data(pmInput)","            .enter()","          .append(\"circle\")","            .attr(\"r\", 0)","            .style(\"fill\", d => d.color)","            .attr(\"cx\", d => projection([d.long, d.lat])[0])","            .attr(\"cy\",  d => projection([d.long, d.lat])[1])","            .style(\"opacity\", 0.6)","            .on(\"mouseover\", tipMouseover)","            .on(\"mouseout\", tipMouseout)","          .transition(d3.transition().duration(1000).ease(d3.easeQuadOut))","            .attr(\"r\", d => d.circleSize)","    }","</script>","`;","","var response = pm.response.json();","let parsedData = [];","","//data parsing","for (let earthquake of response.features){","    let tempEntry = {};","    tempEntry.lat = earthquake.geometry.coordinates[1];","    tempEntry.long = earthquake.geometry.coordinates[0];","    tempEntry.circleSize = Math.abs(Math.ceil(earthquake.properties.mag));","    tempEntry.color = \"#F09D51\";","    parsedData.push(tempEntry);","}","","pm.visualizer.set(template, {","    data: parsedData,","    title: \"Map of Earthquake Occurrences Over Past Three Days\"","} );","",""],"type":"text/javascript"}}],"id":"2825d0ab-41ed-4dc6-ae3b-6bf1d3e2b82b","request":{"method":"GET","header":[],"url":"https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=&endtime=","description":"<p>This request visualizes the response body as a map.</p>\n<p>To visualize your response as a map, replace the sample request URL with your API. Or you can copy the test script from the “Scripts” tab and reuse it.</p>\n","urlObject":{"protocol":"https","path":["fdsnws","event","1","query"],"host":["earthquake","usgs","gov"],"query":[{"key":"format","value":"geojson"},{"key":"starttime","value":""},{"key":"endtime","value":""}],"variable":[]}},"response":[],"_postman_id":"2825d0ab-41ed-4dc6-ae3b-6bf1d3e2b82b"},{"name":"Visualize any CSV data","event":[{"listen":"test","script":{"exec":["var template = `","<link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\">","<style>","    .table {","        font-size: 12px;","    }","</style>","<div id=\"root\"></div>","<script src=\"https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js\"></script>","<script src=\"https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.js\"></script>","<script src=\"https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.21.1/babel.min.js\"></script>","<script src=\"https://cdn.jsdelivr.net/npm/react-csv-to-table@0.0.2/dist/index.min.js\"></script>","<script type=\"text/babel\">","let Table = window['react-csv-to-html-table'].CsvToHtmlTable;","","class App extends React.Component {","    render() {","        return (","            <Table","                tableClassName='table table-striped table-dark table-hover'","                csvDelimiter=','","                {...this.props.data}","            />","        );","    }","}","","pm.getData((err, data) => {","    ReactDOM.render(","        <App data={data} />,","        document.getElementById('root')","    );","});","","</script>","`;","","","// Provide the props as per the documentation","// https://github.com/marudhupandiyang/react-csv-to-table","let tableProps = {","    data: pm.response.text(),","    csvDelimiter: ',',","    hasHeader: false","};","","pm.visualizer.set(template, tableProps);"],"type":"text/javascript"}}],"id":"2a809393-df70-4438-afea-f7ac863cfa0f","request":{"method":"GET","header":[],"url":"https://www.sample-videos.com/csv/Sample-Spreadsheet-100-rows.csv","description":"<p>This request will help you to visualize any CSV.</p>\n<p>Change the URL and run the request, then go to the Visualizer tab to see the CSV as a table.</p>\n<p>In case your CSV isn't rendering correctly, you might need to tweak the delimters or other properties.</p>\n","urlObject":{"protocol":"https","path":["csv","Sample-Spreadsheet-100-rows.csv"],"host":["www","sample-videos","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"2a809393-df70-4438-afea-f7ac863cfa0f"},{"name":"Visualize any JSON data","event":[{"listen":"test","script":{"exec":["// GO TO THE END OF THE TEST SCRIPT.","var template = `","<style>","        .fill,","body,","html {","  height: 100%","}","","#json_vl,",".td_head,",".td_row_even,",".td_row_odd {","  font-size: small","}","","#json_pnl,","#xxa,",".navbar-header,",".navbar-nav,",".navbar-nav>li,",".td_head {","  float: left","}","",".fill {","  min-height: 100%","}","","#json_vl {","  font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace","}","","#widget {","  width: 100%","}","",".top_size {","  height: 51px","}","","#all_panels {","  height: 100%;","  min-height: 100%","}","","#aboutLnk {","  position: fixed;","  right: 10px;","  top: 15px","}","","#inner_text {","  display: block;","  position: absolute;","  height: auto;","  bottom: 0;","  top: 0;","  left: 0;","  right: 0;","  margin-top: 51px;","  margin-bottom: 0","}","","#json_pnl {","  background-color: #ccc;","  width: 33.3%","}","","#xxa {","  background-color: #E8E8E8;","  width: 66.7%","}","","#table_pnl,","#tree_pnl {","  background-color: #E8E8E8;","  float: left;","  width: 50%","}","","#sharethis {","  position: fixed;","  right: 80px;","  top: 10px","}","","#inner_tbl {","  padding-left: 2px","}","",".td_row_even {","  padding: 2px;","  background-color: #F6F4F0","}","",".td_row_odd {","  padding: 2px;","  background-color: #FFF","}","",".td_head {","  padding: 2px;","  font-weight: 700","}","","input,","p,","select,","td,","textarea,","th {","  font-size: 1em","}","","table,","td,","th {","  border: 1px solid gray","}","","textarea {","  -moz-box-sizing: border-box;","  -webkit-box-sizing: border-box;","  box-sizing: border-box;","  display: block;","  width: 100%;","  height: 100%;","  margin: 0;","  padding: 4px;","  border: 1px solid #333;","  overflow-y: auto;","  overflow-x: hidden","}","","*,","html {","  font-family: Verdana, Arial, Helvetica, sans-serif","}","","form,","h1,","h2,","h3,","h4,","h5,","li,","p,","ul {","  margin: 0;","  padding: 0","}","","img {","  border: none","}","","p {","  margin: 0 0 1em","}","","table {","  font-size: 100%;","  background-color: white;","}","","ol.tree {","  padding: 0 0 0 30px;","  width: 300px","}","","li {","  position: relative;","  margin-left: -15px;","  list-style: none","}","","li.file {","  margin-left: -1px !important","}","","li.file a {","  background: url(leaf.png)0 5px no-repeat;","  color: #000;","  padding-left: 12px;","  text-decoration: none;","  display: block;","  font-size: small","}","","li.file a[href$='.css'],","li.file a[href$='.js'],","li.file a[href*='.pdf'],","li.file a[href*='.html'] {","  background: url(http://www.thecssninja.com/demo/css_tree/document.png)no-repeat","}","","li input {","  position: absolute;","  left: 0;","  margin-left: 0;","  opacity: 0;","  z-index: 2;","  cursor: pointer;","  height: 1em;","  width: 1em;","  top: 0","}","","li input+ol {","  background: url(http://www.thecssninja.com/demo/css_tree/toggle-small-expand.png)40px -3px no-repeat;","  margin: -20px 0 0 -44px;","  height: 1em;","  padding: 1.563em 0 0 80px","}","","li label.lbl_array,","li label.lbl_obj {","  display: block;","  padding-left: 33px;","  margin-bottom: 2px","}","","li input+ol>li {","  display: none;","  margin-left: -14px !important;","  padding-left: 1px","}","","li label.lbl_obj {","  background: url(folder.png)15px 1px no-repeat;","  cursor: pointer","}","","li label.lbl_array {","  background: url(array.png)15px 1px no-repeat;","  cursor: pointer","}","","li input:checked+ol {","  background: url(http://www.thecssninja.com/demo/css_tree/toggle-small.png)40px -3px no-repeat;","  margin: -20px 0 0 -44px;","  padding: 1.563em 0 0 80px;","  height: auto","}","","li input:checked+ol>li {","  display: block;","  margin: 0 0 .125em","}","","li input:checked+ol>li:last-child {","  margin: 0 0 .063em","}","",".container {","  width: 970px;","  max-width: none !important","}","",".col-xs-4 {","  padding-top: 15px;","  padding-bottom: 15px;","  background-color: #eee;","  background-color: rgba(86, 61, 124, .15);","  border: 1px solid #ddd;","  border: 1px solid rgba(86, 61, 124, .2)","}","","    </style>","<div id=\"html\">","<input type=\"text\" id=\"json\">","<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>","<!--<script src=\"json2table.js\"></script>-->","<script>","$(function() {","    pm.getData((err, data) => {","        $(\"#json\").val(JSON.stringify(data.json));","        json2table(\"#html\");","    });","});","","function call(a) {","    $(\"#json\").val(JSON.stringify(a, void 0, 2));","    json2table()","}","","function json2table(selector) {","    $(selector).html(buildTable(getJsonVar()));","}","","function getJsonVar() {","    try {","        var a = $.parseJSON($(\"#json\").val());","        $(\"#json\").val(JSON.stringify(a, void 0, 2));","        return a","    } catch (e) {","        //return $(\"#error_msg\").text(e.message), $(\"#errorModal\").modal(\"show\"), {}","        alert(e);","    }","}","","function buildTable(a) {","    var e = document.createElement(\"table\"),","        d, b;","    if (isArray(a)) return buildArray(a);","    for (var c in a) \"object\" != typeof a[c] || isArray(a[c]) ? \"object\" == typeof a[c] && isArray(a[c]) ? (d = e.insertRow(-1), b = d.insertCell(-1), b.colSpan = 2, b.innerHTML = '<div class=\"td_head\">' + encodeText(c) + '</div><table style=\"width:100%\">' + $(buildArray(a[c]), !1).html() + \"</table>\") : (d = e.insertRow(-1), b = d.insertCell(-1), b.innerHTML = \"<div class='td_head'>\" + encodeText(c) + \"</div>\", d = d.insertCell(-1), d.innerHTML = \"<div class='td_row_even'>\" +","        encodeText(a[c]) + \"</div>\") : (d = e.insertRow(-1), b = d.insertCell(-1), b.colSpan = 2, b.innerHTML = '<div class=\"td_head\">' + encodeText(c) + '</div><table style=\"width:100%\">' + $(buildTable(a[c]), !1).html() + \"</table>\");","    return e","}","","function buildArray(a) {","    var e = document.createElement(\"table\"),","        d, b, c = !1,","        p = !1,","        m = {},","        h = -1,","        n = 0,","        l;","    l = \"\";","    if (0 == a.length) return \"<div></div>\";","    d = e.insertRow(-1);","    for (var f = 0; f < a.length; f++)","        if (\"object\" != typeof a[f] || isArray(a[f])) \"object\" == typeof a[f] && isArray(a[f]) ? (b = d.insertCell(h), b.colSpan = 2, b.innerHTML = '<div class=\"td_head\"></div><table style=\"width:100%\">' + $(buildArray(a[f]), !1).html() + \"</table>\", c = !0) : p || (h += 1, p = !0, b = d.insertCell(h), m.empty = h, b.innerHTML = \"<div class='td_head'>&nbsp;</div>\");","        else","            for (var k in a[f]) l =","                \"-\" + k, l in m || (c = !0, h += 1, b = d.insertCell(h), m[l] = h, b.innerHTML = \"<div class='td_head'>\" + encodeText(k) + \"</div>\");","    c || e.deleteRow(0);","    n = h + 1;","    for (f = 0; f < a.length; f++)","        if (d = e.insertRow(-1), td_class = isEven(f) ? \"td_row_even\" : \"td_row_odd\", \"object\" != typeof a[f] || isArray(a[f]))","            if (\"object\" == typeof a[f] && isArray(a[f]))","                for (h = m.empty, c = 0; c < n; c++) b = d.insertCell(c), b.className = td_class, l = c == h ? '<table style=\"width:100%\">' + $(buildArray(a[f]), !1).html() + \"</table>\" : \" \", b.innerHTML = \"<div class='\" + td_class + \"'>\" + encodeText(l) +","                    \"</div>\";","            else","                for (h = m.empty, c = 0; c < n; c++) b = d.insertCell(c), l = c == h ? a[f] : \" \", b.className = td_class, b.innerHTML = \"<div class='\" + td_class + \"'>\" + encodeText(l) + \"</div>\";","    else {","        for (c = 0; c < n; c++) b = d.insertCell(c), b.className = td_class, b.innerHTML = \"<div class='\" + td_class + \"'>&nbsp;</div>\";","        for (k in a[f]) c = a[f], l = \"-\" + k, h = m[l], b = d.cells[h], b.className = td_class, \"object\" != typeof c[k] || isArray(c[k]) ? \"object\" == typeof c[k] && isArray(c[k]) ? b.innerHTML = '<table style=\"width:100%\">' + $(buildArray(c[k]), !1).html() + \"</table>\" : b.innerHTML =","            \"<div class='\" + td_class + \"'>\" + encodeText(c[k]) + \"</div>\" : b.innerHTML = '<table style=\"width:100%\">' + $(buildTable(c[k]), !1).html() + \"</table>\"","    }","    return e","}","","function encodeText(a) {","    return $(\"<div />\").text(a).html()","}","","function isArray(a) {","    return \"[object Array]\" === Object.prototype.toString.call(a)","}","","function isEven(a) {","    return 0 == a % 2","}","</script>`;","","","// In case you only want a specific property, change it here.","//","// Default: You can set the entire JSON response using pm.response.json()","let tableProps = {","    json: pm.response.json()","};","","pm.visualizer.set(template, tableProps);"],"type":"text/javascript","packages":{}}}],"id":"6af78e5c-bf40-45fa-8e4b-3d564214b6c1","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"message\": \"Go to Visualize tab on the right 👉 located alongside the Pretty, Raw, and Preview options. We have added the visualization code to the Scripts tab in the request.\"\n}","options":{"raw":{"language":"json"}}},"url":"https://postman-echo.com/post","description":"<p>This request will help you to visualize any JSON.</p>\n<p>Change the URL and run the request, then go to the Visualizer tab to see the JSON as a table.</p>\n","urlObject":{"protocol":"https","path":["post"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"6af78e5c-bf40-45fa-8e4b-3d564214b6c1"},{"name":"Visualize any XML data","event":[{"listen":"test","script":{"exec":["// GO TO THE END OF THE TEST SCRIPT.","var template = `","<style>","        .fill,","body,","html {","  height: 100%","}","","#json_vl,",".td_head,",".td_row_even,",".td_row_odd {","  font-size: small","}","","#json_pnl,","#xxa,",".navbar-header,",".navbar-nav,",".navbar-nav>li,",".td_head {","  float: left","}","",".fill {","  min-height: 100%","}","","#json_vl {","  font-family: Consolas, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace","}","","#widget {","  width: 100%","}","",".top_size {","  height: 51px","}","","#all_panels {","  height: 100%;","  min-height: 100%","}","","#aboutLnk {","  position: fixed;","  right: 10px;","  top: 15px","}","","#inner_text {","  display: block;","  position: absolute;","  height: auto;","  bottom: 0;","  top: 0;","  left: 0;","  right: 0;","  margin-top: 51px;","  margin-bottom: 0","}","","#json_pnl {","  background-color: #ccc;","  width: 33.3%","}","","#xxa {","  background-color: #E8E8E8;","  width: 66.7%","}","","#table_pnl,","#tree_pnl {","  background-color: #E8E8E8;","  float: left;","  width: 50%","}","","#sharethis {","  position: fixed;","  right: 80px;","  top: 10px","}","","#inner_tbl {","  padding-left: 2px","}","",".td_row_even {","  padding: 2px;","  background-color: #F6F4F0","}","",".td_row_odd {","  padding: 2px;","  background-color: #FFF","}","",".td_head {","  padding: 2px;","  font-weight: 700","}","","input,","p,","select,","td,","textarea,","th {","  font-size: 1em","}","","table,","td,","th {","  border: 1px solid gray","}","","textarea {","  -moz-box-sizing: border-box;","  -webkit-box-sizing: border-box;","  box-sizing: border-box;","  display: block;","  width: 100%;","  height: 100%;","  margin: 0;","  padding: 4px;","  border: 1px solid #333;","  overflow-y: auto;","  overflow-x: hidden","}","","*,","html {","  font-family: Verdana, Arial, Helvetica, sans-serif","}","","form,","h1,","h2,","h3,","h4,","h5,","li,","p,","ul {","  margin: 0;","  padding: 0","}","","img {","  border: none","}","","p {","  margin: 0 0 1em","}","","table {","  font-size: 100%;","  background-color: white;","}","","ol.tree {","  padding: 0 0 0 30px;","  width: 300px","}","","li {","  position: relative;","  margin-left: -15px;","  list-style: none","}","","li.file {","  margin-left: -1px !important","}","","li.file a {","  background: url(leaf.png)0 5px no-repeat;","  color: #000;","  padding-left: 12px;","  text-decoration: none;","  display: block;","  font-size: small","}","","li.file a[href$='.css'],","li.file a[href$='.js'],","li.file a[href*='.pdf'],","li.file a[href*='.html'] {","  background: url(http://www.thecssninja.com/demo/css_tree/document.png)no-repeat","}","","li input {","  position: absolute;","  left: 0;","  margin-left: 0;","  opacity: 0;","  z-index: 2;","  cursor: pointer;","  height: 1em;","  width: 1em;","  top: 0","}","","li input+ol {","  background: url(http://www.thecssninja.com/demo/css_tree/toggle-small-expand.png)40px -3px no-repeat;","  margin: -20px 0 0 -44px;","  height: 1em;","  padding: 1.563em 0 0 80px","}","","li label.lbl_array,","li label.lbl_obj {","  display: block;","  padding-left: 33px;","  margin-bottom: 2px","}","","li input+ol>li {","  display: none;","  margin-left: -14px !important;","  padding-left: 1px","}","","li label.lbl_obj {","  background: url(folder.png)15px 1px no-repeat;","  cursor: pointer","}","","li label.lbl_array {","  background: url(array.png)15px 1px no-repeat;","  cursor: pointer","}","","li input:checked+ol {","  background: url(http://www.thecssninja.com/demo/css_tree/toggle-small.png)40px -3px no-repeat;","  margin: -20px 0 0 -44px;","  padding: 1.563em 0 0 80px;","  height: auto","}","","li input:checked+ol>li {","  display: block;","  margin: 0 0 .125em","}","","li input:checked+ol>li:last-child {","  margin: 0 0 .063em","}","",".container {","  width: 970px;","  max-width: none !important","}","",".col-xs-4 {","  padding-top: 15px;","  padding-bottom: 15px;","  background-color: #eee;","  background-color: rgba(86, 61, 124, .15);","  border: 1px solid #ddd;","  border: 1px solid rgba(86, 61, 124, .2)","}","","    </style>","<div id=\"html\">","<input type=\"text\" id=\"json\">","<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js\"></script>","<!--<script src=\"json2table.js\"></script>-->","<script>","$(function() {","    pm.getData((err, data) => {","        $(\"#json\").val(JSON.stringify(data.json));","        json2table(\"#html\");","    });","});","","function call(a) {","    $(\"#json\").val(JSON.stringify(a, void 0, 2));","    json2table()","}","","function json2table(selector) {","    $(selector).html(buildTable(getJsonVar()));","}","","function getJsonVar() {","    try {","        var a = $.parseJSON($(\"#json\").val());","        $(\"#json\").val(JSON.stringify(a, void 0, 2));","        return a","    } catch (e) {","        //return $(\"#error_msg\").text(e.message), $(\"#errorModal\").modal(\"show\"), {}","        alert(e);","    }","}","","function buildTable(a) {","    var e = document.createElement(\"table\"),","        d, b;","    if (isArray(a)) return buildArray(a);","    for (var c in a) \"object\" != typeof a[c] || isArray(a[c]) ? \"object\" == typeof a[c] && isArray(a[c]) ? (d = e.insertRow(-1), b = d.insertCell(-1), b.colSpan = 2, b.innerHTML = '<div class=\"td_head\">' + encodeText(c) + '</div><table style=\"width:100%\">' + $(buildArray(a[c]), !1).html() + \"</table>\") : (d = e.insertRow(-1), b = d.insertCell(-1), b.innerHTML = \"<div class='td_head'>\" + encodeText(c) + \"</div>\", d = d.insertCell(-1), d.innerHTML = \"<div class='td_row_even'>\" +","        encodeText(a[c]) + \"</div>\") : (d = e.insertRow(-1), b = d.insertCell(-1), b.colSpan = 2, b.innerHTML = '<div class=\"td_head\">' + encodeText(c) + '</div><table style=\"width:100%\">' + $(buildTable(a[c]), !1).html() + \"</table>\");","    return e","}","","function buildArray(a) {","    var e = document.createElement(\"table\"),","        d, b, c = !1,","        p = !1,","        m = {},","        h = -1,","        n = 0,","        l;","    l = \"\";","    if (0 == a.length) return \"<div></div>\";","    d = e.insertRow(-1);","    for (var f = 0; f < a.length; f++)","        if (\"object\" != typeof a[f] || isArray(a[f])) \"object\" == typeof a[f] && isArray(a[f]) ? (b = d.insertCell(h), b.colSpan = 2, b.innerHTML = '<div class=\"td_head\"></div><table style=\"width:100%\">' + $(buildArray(a[f]), !1).html() + \"</table>\", c = !0) : p || (h += 1, p = !0, b = d.insertCell(h), m.empty = h, b.innerHTML = \"<div class='td_head'>&nbsp;</div>\");","        else","            for (var k in a[f]) l =","                \"-\" + k, l in m || (c = !0, h += 1, b = d.insertCell(h), m[l] = h, b.innerHTML = \"<div class='td_head'>\" + encodeText(k) + \"</div>\");","    c || e.deleteRow(0);","    n = h + 1;","    for (f = 0; f < a.length; f++)","        if (d = e.insertRow(-1), td_class = isEven(f) ? \"td_row_even\" : \"td_row_odd\", \"object\" != typeof a[f] || isArray(a[f]))","            if (\"object\" == typeof a[f] && isArray(a[f]))","                for (h = m.empty, c = 0; c < n; c++) b = d.insertCell(c), b.className = td_class, l = c == h ? '<table style=\"width:100%\">' + $(buildArray(a[f]), !1).html() + \"</table>\" : \" \", b.innerHTML = \"<div class='\" + td_class + \"'>\" + encodeText(l) +","                    \"</div>\";","            else","                for (h = m.empty, c = 0; c < n; c++) b = d.insertCell(c), l = c == h ? a[f] : \" \", b.className = td_class, b.innerHTML = \"<div class='\" + td_class + \"'>\" + encodeText(l) + \"</div>\";","    else {","        for (c = 0; c < n; c++) b = d.insertCell(c), b.className = td_class, b.innerHTML = \"<div class='\" + td_class + \"'>&nbsp;</div>\";","        for (k in a[f]) c = a[f], l = \"-\" + k, h = m[l], b = d.cells[h], b.className = td_class, \"object\" != typeof c[k] || isArray(c[k]) ? \"object\" == typeof c[k] && isArray(c[k]) ? b.innerHTML = '<table style=\"width:100%\">' + $(buildArray(c[k]), !1).html() + \"</table>\" : b.innerHTML =","            \"<div class='\" + td_class + \"'>\" + encodeText(c[k]) + \"</div>\" : b.innerHTML = '<table style=\"width:100%\">' + $(buildTable(c[k]), !1).html() + \"</table>\"","    }","    return e","}","","function encodeText(a) {","    return $(\"<div />\").text(a).html()","}","","function isArray(a) {","    return \"[object Array]\" === Object.prototype.toString.call(a)","}","","function isEven(a) {","    return 0 == a % 2","}","</script>`;","","","// In case you only want a specific property, change it here.","//","// For an XML response you can change the following `xmlData` to pm.response.text() instead of pm.response.json().data","let xmlData = pm.response.json().data,","  tableProps = {","      json: xml2Json(xmlData)","  };","","pm.visualizer.set(template, tableProps);"],"type":"text/javascript"}}],"id":"e2b66b67-9214-40a2-8bb2-12d71d3d4adf","request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<book>\n <name>A Song of Ice and Fire</name>\n <author>George R. R. Martin</author>\n <language>English</language>\n <genre>Epic fantasy</genre>\n</book>","options":{"raw":{"language":"json"}}},"url":"https://postman-echo.com/post","description":"<p>This request will help you to visualize any XML.</p>\n<p>Change the URL and run the request, then go to the Visualizer tab to see the XML as a table.</p>\n<p>You can head over to the \"Scripts\" tab, scroll down to the bottom and change the <code>xmlData</code> to <code>pm.response.text()</code> to visualize your entire XML response.</p>\n","urlObject":{"protocol":"https","path":["post"],"host":["postman-echo","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"e2b66b67-9214-40a2-8bb2-12d71d3d4adf"}],"variable":[{"id":"b763b7b7-89bd-4831-93d8-91e1e6a647a4","key":"eq-starttime","value":""},{"id":"76cf7ebd-c2a6-4c00-be69-55b49b4c891b","key":"eq-endtime","value":""}]}