Giter VIP home page Giter VIP logo

carto-api-client's Introduction

CARTO API

Carto Node API

Install

npm install

Run

  • Development
npm run dev
  • Production
npm run build
  • Test
npm run test:build
npm run test:server

Open http://localhost:8081/tests/

Usage

JS

var Carto = require('carto-api-client');
var client = Carto.AuthenticatedClient.setConfig({
  baseUrl: 'foobar.com'
});

client.getUser()
  .then(console.log)
  .catch(console.error);

ES6

import Carto from 'carto-api-client';
const client = Carto.AuthenticatedClient.setConfig({
  baseUrl: 'foobar.com'
});

client.getUser()
  .then(console.log)
  .catch(console.error);

Browser

<script type="text/javascript" src="/carto-api-client/dist/carto-api-client.js"></script>

Browser Support

This library uses a fetch polyfill: whatwg-fetch

Documentation

Config

Visualization

client.getVisualization('myVizId', {} /* optional params */)
  .then(console.log)
  .catch(console.error);

Params

Filters
  • with_id_or_name
  • only_liked (default: true)
  • only_shared (default: true)
  • exclude_shared (default: true)
  • exclude_raster (default: true)
  • locked
  • shared
  • tags
  • bbox
  • privacy
  • only_with_display_name (default: true)
  • per_page
  • page
  • type
  • types
  • order
Options
  • related
  • load_related_canonical_visualizations
  • show_user
  • show_stats
  • show_likes
  • show_liked
  • show_table
  • show_permission
  • show_synchronization
  • show_uses_builder_features
  • show_table_size_and_row_count
  • password

Example:

client.getVisualization('myVizId', {
    privacy: 'PUBLIC',
    per_page: '3',
    show_stats: true,
    show_table_size_and_row_count: true
  })
  .then(console.log)
  .catch(console.error);

carto-api-client's People

Contributors

elenatorro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.