Skip to content
Snippets Groups Projects
Commit df701a3b authored by Andres Gomez Urquiza's avatar Andres Gomez Urquiza
Browse files

merge

parents 87d745b1 b8c6f141
No related branches found
No related tags found
No related merge requests found
Showing
with 412 additions and 26 deletions
......@@ -18,6 +18,7 @@ esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
suppress_comment= \\(.\\|\n\\)*\\$FlowFixMe
module.name_mapper='.*\(\.css\)' -> 'CSSModule'
module.name_mapper='^ace/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/ace-builds/src-min-noconflict/\1'
module.system=haste
strip_root=true
module.file_ext=.js
......
......@@ -21,6 +21,7 @@ profiles.clj
/resources/frontend_client/app/dist/
/resources/frontend_client/index.html
/resources/frontend_client/public.html
/resources/frontend_client/embed.html
/node_modules/
/.babel_cache
/coverage
......
METABASE APP-EMBED.JS
SOFTWARE LICENSE AGREEMENT
PLEASE READ THE FOLLOWING TERMS AND CONDITIONS CAREFULLY BEFORE DOWNLOADING, INSTALLING OR USING THE APP-EMBED.JS SOFTWARE OR ANY ACCOMPANYING DOCUMENTATION (COLLECTIVELY, THE “SOFTWARE”).
THE TERMS AND CONDITIONS OF THIS SOFTWARE LICENSE AGREEMENT (“AGREEMENT”) GOVERN USE OF THE SOFTWARE UNLESS YOU AND METABASE HAVE EXECUTED A SEPARATE AGREEMENT GOVERNING USE OF THE SOFTWARE.
Metabase is willing to license the Software to you only upon the condition that you accept all the terms contained in this Agreement. By downloading, installing or using the Software, you have indicated that you understand this Agreement and accept all of its terms. If you are accepting the terms of this Agreement on behalf of a company or other legal entity, you represent and warrant that you have the authority to bind that company or other legal entity to the terms of this Agreement, and, in such event, “you” and “your” will refer to that company or other legal entity. If you do not accept all the terms of this Agreement, then Metabase is unwilling to license the Software to you, you are not permitted to use the Software, and you must destroy all copies of the Software.
1. **Grant of License**. Conditioned upon your compliance with the terms and conditions of this Agreement, Metabase grants you a non-exclusive and non-transferable license to Execute (as defined herein) the executable form of the Software, free and clear of any Affero GPL License requirements applicable to the Metabase application available for download by the Metabase at its website http://www.metabase.com. Metabase reserves all rights in the Software not expressly granted to you in this Agreement. For purposes of this Agreement, “Execute” and “Execution” means to load, install, and run the Software in order to benefit from its functionality as designed by Metabase.
2. **Restrictions**. Except as expressly specified in this Agreement or otherwise permitted by law notwithstanding this Agreement, you agree not to do any of the following, : (a) copy (except in the course of loading or installing) or modify the Software, including but not limited to modifying or blocking, overlaying, or otherwise obstructing the contents of the embedded element that is embedded in your application via the Software, adding new features, or otherwise making adaptations that alter the functioning of the Software; or (b) transfer, sublicense, lease, lend, rent or otherwise distribute the Software to any third party. You acknowledge and agree that portions of the Software, including but not limited to the source code and the specific design and structure of individual modules or programs, constitute or contain trade secrets of Metabase and its licensors.
3. **Ownership**. The copy of the Software is licensed, not sold. You own the media on which the Software is recorded, but Metabase retains ownership of the copy of the Software itself, including all intellectual property rights therein. The Software is protected by United States copyright law and international treaties. You will not delete or in any manner alter the copyright, trademark, and other proprietary rights notices or markings appearing on the Software as delivered to you. This includes the removal of the Metabase’s name or logo in the iframe that is embedded in your application.
4. **Term**. The license granted under this Agreement remains in effect unless terminated in accordance with this Agreement. You may terminate the license at any time by destroying all copies of the Software in your possession or control. The license granted under this Agreement will automatically terminate, with or without notice from Metabase, if you breach any term of this Agreement. Upon termination, you must promptly destroy all copies of the Software in your possession or control.
5. **No Warranty**. “THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND. METABASE DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT, AND ANY WARRANTIES AND CONDITIONS ARISING OUT OF COURSE OF DEALING OR USAGE OF TRADE. NO ADVICE OR INFORMATION, WHETHER ORAL OR WRITTEN, OBTAINED FROM METABASE OR ELSEWHERE WILL CREATE ANY WARRANTY OR CONDITION NOT EXPRESSLY STATED IN THIS AGREEMENT.”
6. **Limitation of Liability**. METABASE’S TOTAL LIABILITY TO YOU FROM ALL CAUSES OF ACTION AND UNDER ALL THEORIES OF LIABILITY WILL BE LIMITED TO THE AMOUNTS PAID OR PAYABLE TO METABASE BY YOU FOR THE SOFTWARE OR, IN THE EVENT THAT METABASE HAS MADE THE SOFTWARE AVAILABLE TO YOU WITHOUT CHARGE, METABASE’S TOTAL LIABILITY WILL BE LIMITED TO $[500]. IN NO EVENT WILL METABASE BE LIABLE TO YOU FOR ANY SPECIAL, INCIDENTAL, EXEMPLARY, PUNITIVE OR CONSEQUENTIAL DAMAGES (INCLUDING LOSS OF DATA, BUSINESS, PROFITS OR ABILITY TO EXECUTE) OR FOR THE COST OF PROCURING SUBSTITUTE PRODUCTS ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT OR THE EXECUTION OR PERFORMANCE OF THE SOFTWARE, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, AND WHETHER OR NOT METABASE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE. THE FOREGOING LIMITATIONS WILL SURVIVE AND APPLY EVEN IF ANY LIMITED REMEDY SPECIFIED IN THIS AGREEMENT IS FOUND TO HAVE FAILED OF ITS ESSENTIAL PURPOSE.
8. **U.S. Government End Users**. The Software and Documentation are “commercial items” as that term is defined in FAR 2.101, consisting of “commercial computer software” and “commercial computer software documentation,” respectively, as such terms are used in FAR 12.212 and DFARS 227.7202. If the Software and Documentation are being acquired by or on behalf of the U.S. Government, then, as provided in FAR 12.212 and DFARS 227.7202-1 through 227.7202-4, as applicable, the U.S. Government’s rights in the Software and Documentation will be only those specified in this Agreement.
9. **Export Law**. You agree to comply fully with all U.S. export laws and regulations to ensure that neither the Software nor any technical data related thereto nor any direct product thereof are exported or re-exported directly or indirectly in violation of, or used for any purposes prohibited by, such laws and regulations.
10. **General**. This Agreement will be governed by and construed in accordance with the laws of the State of California, without regard to or application of conflict of laws rules or principles. The United Nations Convention on Contracts for the International Sale of Goods will not apply. You may not assign or transfer this Agreement or any rights granted hereunder, by operation of law or otherwise, without Metabase’s prior written consent, and any attempt by you to do so, without such consent, will be void. Except as expressly set forth in this Agreement, the exercise by either party of any of its remedies under this Agreement will be without prejudice to its other remedies under this Agreement or otherwise. All notices or approvals required or permitted under this Agreement will be in writing and delivered by confirmed facsimile transmission, by overnight delivery service, or by certified mail, and in each instance will be deemed given upon receipt. All notices or approvals will be sent to the addresses specified by either party to the other in accordance with this section. The failure by either party to enforce any provision of this Agreement will not constitute a waiver of future enforcement of that or any other provision. Any waiver, modification or amendment of any provision of this Agreement will be effective upon Metabase posting the modified terms of this Agreement to the Metabase website. If any provision of this Agreement is held to be unenforceable or invalid, that provision will be enforced to the maximum extent possible, and the other provisions will remain in full force and effect. This Agreement is the complete and exclusive understanding and agreement between the parties regarding its subject matter, and supersedes all proposals, understandings or communications between the parties, oral or written, regarding its subject matter, unless you and Metabase have executed a separate agreement. Any terms or conditions contained in your purchase order, if any, or other ordering document that are inconsistent with or in addition to the terms and conditions of this Agreement are hereby rejected by Metabase and will be deemed null.
11. **Contact Information**. If you have any questions regarding this Agreement, you may contact Metabase by email at legal@metabase.com, phone by (415) 767-0490 or by mail at 660 4th Street #557, San Francisco, CA 94107.
......@@ -10,7 +10,7 @@ Metabase is the easy, open source way for everyone in your company to ask questi
[![NPM Dependencies Status](https://david-dm.org/metabase/metabase.svg)](https://david-dm.org/metabase/metabase)
[![Issue Stats](http://issuestats.com/github/metabase/metabase/badge/pr)](http://issuestats.com/github/metabase/metabase)
[![Issue Stats](http://issuestats.com/github/metabase/metabase/badge/issue)](http://issuestats.com/github/metabase/metabase)
# Features
- 5 minute [setup](http://www.metabase.com/docs/latest/setting-up-metabase) (We're not kidding)
- Let anyone on your team [ask questions](http://www.metabase.com/docs/latest/users-guide/03-asking-questions) without knowing SQL
......@@ -18,7 +18,7 @@ Metabase is the easy, open source way for everyone in your company to ask questi
- SQL Mode for analysts and data pros
- Create canonical [segments and metrics](http://www.metabase.com/docs/latest/administration-guide/07-segments-and-metrics) for your team to use
- Send data to Slack or email on a schedule with [Pulses](http://www.metabase.com/docs/latest/users-guide/09-pulses)
- View data in Slack anytime with [Metabot](http://www.metabase.com/docs/latest/users-guide/10-metabot)
- View data in Slack anytime with [MetaBot](http://www.metabase.com/docs/latest/users-guide/10-metabot)
- [Humanize data](http://www.metabase.com/docs/latest/administration-guide/03-metadata-editing) for your team by renaming, annotating and hiding fields
For more information check out [metabase.com](http://www.metabase.com)
......
#!/usr/bin/env node
/*eslint-env node */
/*eslint-disable import/no-commonjs */
var jwt = require("jsonwebtoken");
var BASE_URL = "http://localhost:3000";
var METABASE_EMBED_SECRET_KEY = process.env["MB_EMBEDDING_SECRET_KEY"];
var resourceType = process.argv[2];
var resourceId = parseFloat(process.argv[3]);
var params = process.argv[4] ? JSON.parse(process.argv[4]) : {};
if (!METABASE_EMBED_SECRET_KEY || !resourceType || typeof resourceId !== "number" || isNaN(resourceId)) {
process.stderr.write("USAGE: MB_EMBEDDING_SECRET_KEY=ABCD embed-sign <resource_type> <resource_id> [<params_json>]\n");
process.exit(1);
}
var resource = {};
resource[resourceType] = resourceId;
var unsignedToken = {
resource: resource,
params: params
};
process.stderr.write(JSON.stringify(unsignedToken, null, 2) + "\n");
var signedToken = jwt.sign(unsignedToken, METABASE_EMBED_SECRET_KEY);
console.log(BASE_URL + "/embed/" + resourceType + "/" + signedToken);
#!/usr/bin/env bash
VERSION="v0.23.0-snapshot"
VERSION="v0.24.0-snapshot"
# dynamically pull more interesting stuff from latest git commit
HASH=$(git show-ref --head --hash=7 head) # first 7 letters of hash should be enough; that's what GitHub uses
......
## Sharing and embedding dashboards or questions
Sometimes you'll want to share a dashboard or question you've saved with someone that isn't a part of your organization or company, or someone who doesn't need access to your full Metabase instance. Metabase lets administrators create public links and simple embeds to let you do just that.
### Turning public links on
![Enable public sharing](images/public-links/enable-public-sharing.png)
First things first, you'll need to go to the Admin Panel and enable public sharing. In the future, you'll see dashboards and questions you've shared listed here, and you'll be able to revoke any public links that you no longer want to be used.
### Enable sharing on your dashboard or saved question
![Enable sharing](images/public-links/enable-links.png)
Next, exit the Admin Panel and go to the dashboard or question that you want to share, then click on the `Sharing and Embedding` icon in the top-right of the screen (it looks like a box with an arrow pointing up). Then click on the toggle to enable public sharing for this dashboard or question.
### Copy, paste, and share!
Now just copy and share the public link URL with whomever you please. If you want to embed your dashboard or question in a simple web page or blog post, then copy and paste the iframe snippet to your destination of choice.
If you're trying to do more complex, integrated embedding in your own web application, then you can check out the [documentation for that feature](13-embedding.md).
## Embedding Metabase in other applications
Metabase includes a powerful application embedding feature that allows you to embed your saved questions or dashboards in your own web applications. You can even pass parameters to these embeds to customize them for different users.
### Key Concepts
#### Applications
An important distinction to keep in mind is the difference between Metabase and the embedding application. The charts and dashboards you will be embedding live in the Metabase application, and will be embedded in your application (i.e. the embedding application).
#### Parameters
Some dashboards and questions have the ability to accept parameters. In dashboards, these are synonymous with dashboard filters. For example, if you have a dashboard with a filter on Publisher ID, this can be specified as a parameter when embedding, so that you could insert the dashboard filtered down to a specific Publisher ID.
SQL based questions with template variables can also accept parameters for each variable. So for a query like
```
SELECT count(*)
FROM orders
WHERE product_id = {{productID}}
```
you could specify a specific productID when embedding the question.
#### Signed parameters
In general, when embedding a chart or dashboard, the server of your embedding application will need to sign a request for that resource.
If you choose to sign a specific parameter value, that means the user can't modify that, nor is a filter widget displayed for that parameter. For example, if the "Publisher ID" is assigned a value and the request signed, that means the front-end client that renders that dashboard on behalf of a given logged-in user can only see information for that publisher ID.
### Enabling embedding
To enable embedding, go to the Admin Panel and under Settings, go to the "Embedding in other applications" tab. From there, click "Enable." Here you will see a secret signing key you can use later to sign requests. If you ever need to invalidate that key and generate a new one, just click on "Regenerate Key".
![Enabling Embedding](images/embedding/01-enabling.png)
You can also see all questions and dashboards that have been marked as "Embeddable" here, as well as revoke any questions or dashboards that should no longer be embeddable in other applications.
Once you've enabled the embedding feature on your Metabase instance, you should then go to the individual questions and dashboards you wish to embed to set them up for embedding.
### Embedding Charts and Dashboards
To mark a given question or dashboard, click on the sharing icon
![Share icon](images/embedding/02-share-icon.png)
Then select "Embed this question in an application"
![Enable sharing for a question](images/embedding/03-enable-question.png)
Here you will see a preview of the question or dashboard as it will appear in your application, as well as a panel that shows you the code you will need to insert in your application.
![Preview](images/embedding/04-preview.png)
Importantly, you will need to hit "Publish" when you first set up a chart or dashboard for embedding and each time you change your embedding settings. Also, any changes you make to the resource might require you to update the code in your own application to the latest code sample in the "Code Pane".
![Code samples for embedding](images/embedding/05-code.png)
We provide code samples for common front end template languages as well as some common back-end web frameworks and languages. You may also use these as starting points for writing your own versions in other platforms.
### Embedding Charts and Dashboards with locked parameters
If you wish to have a parameter locked down to prevent your embedding application's end users from seeing other users' data, you can mark parameters as "Locked."Once a parameter is marked as Locked, it is not displayed as a filter widget, and must be set by the embedding application's server code.
![Locked parameters](images/embedding/06-locked.png)
### Reference applications
To see concrete examples of how to embed Metabase in applications under a number of common frameworks, check out our [reference implementations](https://github.com/metabase/embedding-reference-apps) on Github.
## That’s it!
If you still have questions, or want to share Metabase tips and tricks, head over to our [discussion board](http://discourse.metabase.com/). See you there!
docs/administration-guide/images/embedding/01-enabling.png

57.1 KiB

docs/administration-guide/images/embedding/02-share-icon.png

4.63 KiB

docs/administration-guide/images/embedding/03-enable-question.png

63.9 KiB

docs/administration-guide/images/embedding/04-preview.png

62.7 KiB

docs/administration-guide/images/embedding/05-code.png

104 KiB

docs/administration-guide/images/embedding/06-locked.png

31 KiB

docs/administration-guide/images/public-links/enable-links.png

30.1 KiB

docs/administration-guide/images/public-links/enable-public-sharing.png

33.8 KiB

......@@ -15,6 +15,8 @@ Are you in charge of managing Metabase for your organization? Then you're in the
* [Setting up Slack integration](09-setting-up-slack.md)
* [Enabling single sign-on with Google](10-single-sign-on.md)
* [Creating a Getting Started Guide for your team](11-getting-started-guide.md)
* [Sharing dashboards and questions with public links](12-public-links.md)
* [Embedding Metabase in other Applications](13-embedding.md)
First things first, you'll need to install Metabase. If you haven’t done that yet, our [Installation Guide](../operations-guide/start.md#installing-and-running-metabase) will help you through the process.
......
......@@ -73,6 +73,20 @@ Get `Card` with ID.
* **`id`**
## `GET /api/card/embeddable`
Fetch a list of Cards where `enable_embedding` is `true`. The cards can be embedded using the embedding endpoints and a signed JWT.
You must be a superuser to do this.
## `GET /api/card/public`
Fetch a list of Cards with public UUIDs. These cards are publically-accessible *if* public sharing is enabled.
You must be a superuser to do this.
## `POST /api/card/`
Create a new `Card`.
......@@ -177,21 +191,25 @@ Update a `Card`.
##### PARAMS:
* **`id`**
* **`dataset_query`**
* **`visualization_settings`** value may be nil, or if non-nil, value must be a map.
* **`description`** value may be nil, or if non-nil, value must be a non-blank string.
* **`display`** value may be nil, or if non-nil, value must be a non-blank string.
* **`archived`** value may be nil, or if non-nil, value must be a boolean.
* **`enable_embedding`** value may be nil, or if non-nil, value must be a boolean.
* **`collection_id`** value may be nil, or if non-nil, value must be an integer greater than zero.
* **`name`** value may be nil, or if non-nil, value must be a non-blank string.
* **`visualization_settings`** value may be nil, or if non-nil, value must be a map.
* **`embedding_params`** value may be nil, or if non-nil, value must be a valid embedding params map.
* **`archived`** value may be nil, or if non-nil, value must be a boolean.
* **`dataset_query`** value may be nil, or if non-nil, value must be a map.
* **`collection_id`** value may be nil, or if non-nil, value must be an integer greater than zero.
* **`id`**
* **`display`** value may be nil, or if non-nil, value must be a non-blank string.
## `GET /api/collection/`
......@@ -321,6 +339,20 @@ Fetch `Revisions` for `Dashboard` with ID.
* **`id`**
## `GET /api/dashboard/embeddable`
Fetch a list of Dashboards where `enable_embedding` is `true`. The dashboards can be embedded using the embedding endpoints and a signed JWT.
You must be a superuser to do this.
## `GET /api/dashboard/public`
Fetch a list of Dashboards with public UUIDs. These dashboards are publically-accessible *if* public sharing is enabled.
You must be a superuser to do this.
## `POST /api/dashboard/`
Create a new `Dashboard`.
......@@ -379,24 +411,31 @@ Revert a `Dashboard` to a prior `Revision`.
Update a `Dashboard`.
Usually, you just need write permissions for this Dashboard to do this (which means you have appropriate permissions for the Cards belonging to this Dashboard),
but to change the value of `enable_embedding` you must be a superuser.
##### PARAMS:
* **`id`**
* **`parameters`** value may be nil, or if non-nil, value must be an array. Each value must be a map.
* **`description`**
* **`points_of_interest`** value may be nil, or if non-nil, value must be a non-blank string.
* **`name`** value must be a non-blank string.
* **`description`** value may be nil, or if non-nil, value must be a non-blank string.
* **`parameters`** value must be an array. Each value must be a map.
* **`show_in_getting_started`** value may be nil, or if non-nil, value must be a non-blank string.
* **`caveats`**
* **`enable_embedding`** value may be nil, or if non-nil, value must be a boolean.
* **`points_of_interest`**
* **`name`** value may be nil, or if non-nil, value must be a non-blank string.
* **`show_in_getting_started`**
* **`caveats`** value may be nil, or if non-nil, value must be a non-blank string.
* **`dashboard`**
* **`embedding_params`** value may be nil, or if non-nil, value must be a valid embedding params map.
* **`id`**
## `PUT /api/dashboard/:id/cards`
......@@ -602,6 +641,100 @@ You must be a superuser to do this.
* **`settings`** value must be a map.
## `GET /api/embed/card/:token`
Fetch a Card via a JSON Web Token signed with the `embedding-secret-key`.
Token should have the following format:
{:resource {:question <card-id>}}
##### PARAMS:
* **`token`**
## `GET /api/embed/card/:token/query`
Fetch the results of running a Card using a JSON Web Token signed with the `embedding-secret-key`.
Token should have the following format:
{:resource {:question <card-id>}
:params <parameters>}
##### PARAMS:
* **`token`**
* **`&`**
* **`query-params`**
## `GET /api/embed/card/:token/query/csv`
Like `GET /api/embed/card/query`, but returns the results as CSV.
##### PARAMS:
* **`token`**
* **`&`**
* **`query-params`**
## `GET /api/embed/card/:token/query/json`
Like `GET /api/embed/card/query`, but returns the results as JSOn.
##### PARAMS:
* **`token`**
* **`&`**
* **`query-params`**
## `GET /api/embed/dashboard/:token`
Fetch a Dashboard via a JSON Web Token signed with the `embedding-secret-key`.
Token should have the following format:
{:resource {:dashboard <dashboard-id>}}
##### PARAMS:
* **`token`**
## `GET /api/embed/dashboard/:token/dashcard/:dashcard-id/card/:card-id`
Fetch the results of running a Card belonging to a Dashboard using a JSON Web Token signed with the `embedding-secret-key`.
Token should have the following format:
{:resource {:dashboard <dashboard-id>}
:params <parameters>}
Additional dashboard parameters can be provided in the query string, but params in the JWT token take precedence.
##### PARAMS:
* **`token`**
* **`dashcard-id`**
* **`card-id`**
* **`&`**
* **`query-params`**
## `GET /api/field/:id`
Get `Field` with ID.
......@@ -959,6 +1092,54 @@ You must be a superuser to do this.
* **`name`** value must be a non-blank string.
## `GET /api/preview-embed/card/:token`
Fetch a Card you're considering embedding by passing a JWT TOKEN.
##### PARAMS:
* **`token`**
## `GET /api/preview-embed/card/:token/query`
Fetch the query results for a Card you're considering embedding by passing a JWT TOKEN.
##### PARAMS:
* **`token`**
* **`&`**
* **`query-params`**
## `GET /api/preview-embed/dashboard/:token`
Fetch a Dashboard you're considering embedding by passing a JWT TOKEN.
##### PARAMS:
* **`token`**
## `GET /api/preview-embed/dashboard/:token/dashcard/:dashcard-id/card/:card-id`
Fetch the results of running a Card belonging to a Dashboard you're considering embedding with JWT TOKEN.
##### PARAMS:
* **`token`**
* **`dashcard-id`**
* **`card-id`**
* **`&`**
* **`query-params`**
## `GET /api/public/card/:uuid`
Fetch a publically-accessible Card an return query results as well as `:card` information. Does not require auth credentials. Public sharing must be enabled.
......@@ -967,10 +1148,19 @@ Fetch a publically-accessible Card an return query results as well as `:card` in
* **`uuid`**
## `GET /api/public/card/:uuid/query`
Fetch a publically-accessible Card an return query results as well as `:card` information. Does not require auth credentials. Public sharing must be enabled.
##### PARAMS:
* **`uuid`**
* **`parameters`** value may be nil, or if non-nil, value must be a valid JSON string.
## `GET /api/public/card/:uuid/csv`
## `GET /api/public/card/:uuid/query/csv`
Fetch a publically-accessible Card and return query results as CSV. Does not require auth credentials. Public sharing must be enabled.
......@@ -981,7 +1171,7 @@ Fetch a publically-accessible Card and return query results as CSV. Does not req
* **`parameters`** value may be nil, or if non-nil, value must be a valid JSON string.
## `GET /api/public/card/:uuid/json`
## `GET /api/public/card/:uuid/query/json`
Fetch a publically-accessible Card and return query results as JSON. Does not require auth credentials. Public sharing must be enabled.
......@@ -1014,6 +1204,21 @@ Fetch the results for a Card in a publically-accessible Dashboard. Does not requ
* **`parameters`** value may be nil, or if non-nil, value must be a valid JSON string.
## `GET /api/public/oembed`
oEmbed endpoint used to retreive embed code and metadata for a (public) Metabase URL.
##### PARAMS:
* **`url`** value must be a non-blank string.
* **`format`** value may be nil, or if non-nil, value must be one of: `json`.
* **`maxheight`** value may be nil, or if non-nil, value must be a valid integer.
* **`maxwidth`** value may be nil, or if non-nil, value must be a valid integer.
## `DELETE /api/pulse/:id`
Delete a `Pulse`.
......@@ -1493,7 +1698,7 @@ This endpoints provides an image with the appropriate pins rendered given a MBQL
## `DELETE /api/user/:id`
Disable a `User`. This does not remove the `User` from the db and instead disables their account.
Disable a `User`. This does not remove the `User` from the DB, but instead disables their account.
You must be a superuser to do this.
......@@ -1595,6 +1800,12 @@ Logs.
You must be a superuser to do this.
## `GET /api/util/random_token`
Return a cryptographically secure random 32-byte token, encoded as a hexidecimal string.
Intended for use when creating a value for `embedding-secret-key`.
## `GET /api/util/stats`
Anonymous usage stats. Endpoint for testing, and eventually exposing this to instance admins to let them see
......
......@@ -12,6 +12,7 @@ In Metabase, an answer to a question can be visualized in a number of ways:
* Area chart
* Scatterplot or bubble chart
* Pie/donut chart
* Funnel
* Map
To change how the answer to your question is displayed, click on the Visualization dropdown menu beneath the question builder bar.
......@@ -29,14 +30,26 @@ Each visualization type has its own advanced options you can tweak. Just click t
#### Numbers
This option is for displaying a single number, nice and big. The options for numbers include adding character prefixes or suffixes to it (so you can do things like put a currency symbol in front or a percent at the end), setting the number of decimal places you want to include, and multiplying your result by a number (like if you want to multiply a decimal by 100 to make it look like a percent).
![Number](images/visualizations/number.png)
#### Progress bars
Progress bars are for comparing a single number result to a goal value that you input. Open up the chart options for your progress bar to choose a goal for it, and Metabase will show you how far away your question's current result is from the goal.
![Progress bar](images/visualizations/progress.png)
#### Tables
The Table option is good for looking at tabular data (duh), or for lists of things like users. The options allow you to hide and rearrange fields in the table you're looking at.
The Table option is good for looking at tabular data (duh), or for lists of things like users. The options allow you to hide and rearrange fields in the table you're looking at. If your table is a result that contains one metric and two dimensions, Metabase will also automatically pivot your table, like in the example below (the example shows the count of orders grouped by the review rating for that order and the category of the product that was purchased; you can tell it's pivoted because the grouping field values are all in the first column and first row). You can turn this behavior off in the chart settings.
![Pivot table](images/visualizations/pivot.png)
#### Line, bar, and area charts
Line charts are best for displaying the trend of a number over time, especially when you have lots of x-axis values. Bar charts are great for displaying a metric grouped by a category (e.g., the number of users you have by country), and they can also be useful for showing a number over time if you have a smaller number of x-axis values (like orders per month this year). Area charts are useful when comparing the the proportions between two metrics over time. Both bar and area charts can be stacked.
Line charts are best for displaying the trend of a number over time, especially when you have lots of x-axis values. Bar charts are great for displaying a metric grouped by a category (e.g., the number of users you have by country), and they can also be useful for showing a number over time if you have a smaller number of x-axis values (like orders per month this year).
![Bar chart](images/visualizations/bar.png)
Area charts are useful when comparing the the proportions between two metrics over time. Both bar and area charts can be stacked.
![Stacked area chart](images/visualizations/area.png)
These three charting types have very similar options, which are broken up into the following:
......@@ -52,18 +65,34 @@ If you have a third numeric field, you can also create a bubble chart. Select th
Scatterplots and bubble charts also have similar chart options as line, bar, and area charts.
![Scatter](images/visualizations/scatter.png)
#### Pie or donut charts
A pie or donut chart can be used when breaking out a metric by a single dimension, especially when the number of possible breakouts is small, like users by gender. If you have more than a few breakouts, like users by country, it's usually better to use a bar chart so that your users can more easily compare the relative sizes of each bar.
The options for pie charts let you choose which field to use as your measurement, and which one to use for the dimension (i.e., the pie slices). You can also customize the pie chart's legend, whether or not to show each slice's percent of the whole in the legend, and the minimum size a slice needs to be in order for it to be displayed.
![Donut](images/visualizations/donut.png)
#### Funnel
Funnels are commonly used in e-commerce or sales to visualize how many customers are present within each step of a checkout flow or sales cycle. At their most general, funnels show you values broken out by steps, and the percent decrease between each successive step. To create a funnel in Metabase, you'll need to have a table with at least two columns: one column that contains the metric you're interested in, and another that contains the funnel's steps.
For example, I might have an Opportunities table, and I could create a question that gives me the number of sales leads broken out by a field that contains stages such as `Prospecting`, `Qualification`, `Proposal`, `Negotiation`, and `Closed`. In this example, the percentages shown along the x-axis tell you what percent of the total starting opportunities are still present at each subsequent step; so 18.89% of our total opportunities have made it all the way to being closed deals. The number below each percent is the actual value of the count at that step — in our example, the actual number of opportunities that are currently at each step. Together, these numbers help you figure out where you're losing your customers or users.
![Funnel](images/visualizations/funnel.png)
#### Maps
When you select the Map visualization setting, Metabase will automatically try and pick the best kind of map to use based on the table or result set you're currently looking at. Here are the maps that Metabase uses:
* **United States Map** — Creating a map of the United States from your data requires your results to contain a column field with states. This lets you do things like visualize the count of your users broken out by state, with darker states representing more users.
* **Country Map** — To visualize your results in the format of a map of the world broken out by country, your result must contain a field with countries. (E.g., count of users by country.)
![Region map](images/visualizations/map.png)
* **Pin Map** — If your table contains a latitude and longitude field, Metabase will try to display it as a pin map of the world. This will put one pin on the map for each row in your table, based on the latitude and longitude fields. You can try this with the Sample Dataset that's included in Metabase: start a new question and select the People table, use `raw data` for your view, and choose the Map option for your visualization. you'll see a map of the world, with each dot representing the latitude and longitude coordinates of a single person from the People table.
![Pin map](images/visualizations/pin-map.png)
When you open up the Map options, you can manually switch between a region map (i.e., United States or world) and a pin map. If you're using a region map, you can also choose which field to use as the measurement, and which to use as the region (i.e. State or Country).
Metabase now also allows administrators to add custom region maps via GeoJSON files through the Metabase Admin Panel.
......
## Sharing Your Questions and Answers
## Sharing your questions and answers
---
### How to Save a Question
### How to save a question
Whenever you’ve arrived at an answer that you want to save for later, click the **SAVE** button in the top right of the screen. This will also save the visualization option you’ve chosen for your answer.
![savebutton](images/SaveButton.png)
......@@ -11,7 +11,12 @@ A pop-up box will appear, you to give your question a name and a description. We
Now, whenever you want to refer to your question again you can find it in the saved questions list by clicking on the **Questions** link from the main navigation. To edit your question, go to it and click the pencil icon in the top-right.
### Organizing and Finding your Saved Questions
### Sharing questions with public links
If your Metabase administrator has enabled [public sharing](../administration-guide/12-public-links.md) on a saved question or dashboard, you can go to that question or dashboard and click on the sharing icon to find its public links. Public links can be viewed by anyone, even if they don't have access to Metabase. You can also use the public embedding code to embed your question or dashboard in a simple web page or blog post.
![Share icon](images/share-icon.png)
### Organizing and finding your saved questions
After your team has been using Metabase for a while, you’ll probably end up with lots of saved questions. The Questions page has several tools that’ll help you organize things and find what you’re looking for.
![Questions](images/saved-questions.png)
......@@ -45,5 +50,5 @@ Clicking on the icon to the left of questions let's you select several at once s
---
## Next: Creating dashboards
## Next: creating dashboards
Next, we'll learn about [creating dashboards and adding questions to them](06-dashboards.md).
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment