GithubHelp home page GithubHelp logo

latitude-dev / latitude Goto Github PK

View Code? Open in Web Editor NEW
453.0 4.0 16.0 3.36 MB

Developer-first embedded analytics

Home Page: https://latitude.so

License: GNU Lesser General Public License v3.0

JavaScript 3.94% TypeScript 73.23% HTML 0.93% CSS 0.13% Svelte 21.76%
analytics data data-analysis data-analytics data-app data-science embedded-analytics javascript-framework open-source business-intelligence

latitude's People

Contributors

andresgutgon avatar cesr avatar csansoon avatar geclos avatar github-actions[bot] avatar samulatitude avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

latitude's Issues

Select component

Add a Select input component that also allows using results of a query as options.

Environment variables

Latitude is prepared to handle env vars for secrets and other shenanigans, but we need to add support for a .env file in the root folder of a Latitude app.

Add sentry

We need more visibility on CLI errors. Add optional error reporting via sentry to the CLI.

Notify new CLI versions

Currently the Latitude CLI update is a manual npm update -g @latitude-data/cli, it doesn't notify when there is a new version and may cause bugs or incompatibilities. We should notify users of new CLI versions when they use a command.

Add documentation on CONTRIBUTING

Users are starting to ask how to contribute to the project. We need to add some documentation on how to get set up with development.

`latitude run` command

CLI command with nicely formatted results so that you can debug your queries.

  • Add watcher so that it's dynamic
  • Use console.table so that it prints results in a nice format

Failed to install dependencies

Really wanted to try Latitude it looks so great! Would love some help here whenever possible :)

latitude start
Checking for updates...
? Whats the name of your project? latitude-app
? 🌟 Help us make Latitude better for you by sharing anonymous usage dataβ€”it’s a simple way
 to contribute, with full control to opt-in or opt-out at any time. No, maybe later
? 🌟 Help us make Latitude better for you by sharing anonymous usage dataβ€”it’s a simple way
 to contribute, with full control to opt-in or opt-out at any time. (Use arrow keys)
❯ Yes, count me in!
  No, maybe laterπŸ“¦ Cloning template to /latitude-app
βœ… template cloned
βœ… Created latitude.json
Downloading from: https://registry.npmjs.org/@latitude-data/server/-/server-0.4.0.tgz
Uninstalling old app version...
App server downloaded successfully πŸŽ‰
Installing dependencies...
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Error ──────────────────────────────────────────┐
β”‚                                                                                          β”‚
β”‚                                                                                          β”‚
β”‚                                                                                          β”‚
β”‚                                                                                          β”‚
β”‚               🚨 Failed to install dependencies                                          β”‚
β”‚                                                                                          β”‚
β”‚               Update latitude and try again. If this does not solve the problem,         β”‚
β”‚               please open an issue on GitHub:                                            β”‚
β”‚               https://gitub.com/latitude-dev/latitude/issues                             β”‚
β”‚                                                                                          β”‚
β”‚         ERROR:                                                                           β”‚
β”‚         false                                                                            β”‚
β”‚                                                                                          β”‚
β”‚                                                                                          β”‚
β”‚                                                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

VS Code extension

Latitude does some automatic transformations to your code that do no play nicely with existing lsps and code completion, we need to provide at least a VS Code extension so that developing a Latitude app feels natural from the code editor.

Make Pie chart columns configurable

What?

Now the columns used from the query in a <PieChart /> are always the first as dimension and the second as metric

So for example a table like this

Source Amounts Whatever
Search Engine 1048 33
Direct 735 33
Email 580 33
Union Ads 484 33
Video Ads 300 33

You can pass metric and dimension like this

<PieChart metric='Amounts' dimension='Source' />

The problem

If for some reason you want to use a data that looks like this

Source Whatever Amounts
Search Engine 33 1048
Direct 33 735
Email 33 580
Union Ads 33 484
Video Ads 33 300

It wont work. We have to implement metric and dimension props for pie chart

Full test

DO IN ORDER

  • Review ALL package licenses
  • Publish npm
  • Test package works in production @cesr

QA tasks

  • When using read_csv the file is not found because it's a static in a different folder

Revert support to npm

From the get go we tried to support whatever package manager the user was using in Latitude's CLI: pnpm yarn or npm. The problem with this is that we either have to ask the user what manager they want the CLI to use or we have to take a guess, which more often than not could be wrong. In order to deliver a more robust solution and taking into consideration our bandwith we are gonna remove support for alternative package managers and instead focus on providing a rock solid solution with npm, which ships with all versions of NodeJS and is plenty fast for all versions of node that Latitude supports.

React components

WAT

We want to offer a standalone library of react components that communicate with a Latitude backend, so that you can easily integrate more deeply Latitude into existing codebases.

TODO

  • Implement data layer in @latitude-data/react here
  • Implement latitude-embed JS component to communicate with an embedded iframe of a latitude app here
  • Implement native React components for tables & visualizations

Latitude's CSS authoring approach

WHAT?

The idea is to have a common theming system that can be shared between different client framkeworks implementations of Latitude sdk components. Svelte, React, Vue...

TODO

  • Extract theme and Tailwind config
  • Generate individual CSS files for each component

CSS

We have two ways of using Latitude sdk components.

a) Use the components and you build the CSS

This is the way you want to use if you maximum configuration. If you want to override some of the Tailwind config. This way require that you have in your dev bundler (Vite, Webpack,...) a way of running Tailwind.

You have to extend your Tailwind config with SDK client theme

// your-project/tailwind.config.js
{
  extends: ["@latitude-sdk/client/theme/tailwind.config.js"],
  // ... Extend with your custom config
}

### b) Use individual exported CSS files
This way is ideal if you are ok with our theme system and you just want to use the components. The components that comes from our client implementations: `@latitude-sdk/svelte`, `@latitude-sdk/react` comes without styles. If you implemented a) you will see those styles. The other way is by importing our pre-build CSS files.

You can import all the CSS generated by our components (the easiest but more heaviest way)
``` javascript
import '@latitude-sdk/client/css/all.min.css'

Or you can import only the components you use

import '@latitude-sdk/client/css/button.min.css'
import '@latitude-sdk/client/css/chart.min.css'
import '@latitude-sdk/client/css/column.min.css'
//....

How to extract individual CSS files.

Here is a starting point but the idea is to use tailwind config for each component and in the Tailwind content put only the path to the component. This way the files are smaller and can be imported individually.

  • NOTE: Not sure if it's worthy do this. Let's wait to see if there are people that needs this way of working with our CSS.

Spike: AI integration

Some users have asked about a potential integration wtih LLM providers that would help them develop Latitude projects and write queries. We need to invesigate the fesability of providing an AI-assistant solution without hardcoding an integration with non-OSS providers like OpenAI. To be clear, OpenAI could be one of the supported providers, but I think the solution should be provider-agnostic so that people can integrate with whatever AI solution they want.

Encrypted params

What?

We want to allow users of the framework to pass encrypted params that they can use when embedding the view in an iframe. Example:

<iframe src="https://your-latitudepage.com/some/query?secret=ENCRYPTED" />

So the idea is to pass to the API this secret or whatever you want to call your secret param and decrypt it on the server so only the owner of your-latitudepage.com can know what's the value of ENCRYPTED.

Considerations

We need to think about how to differentiate between encrypted and non-encrypted params. One idea could be to add a prefix to the value or the name of the param
To the name:

lt__secret=ENCRYPTED

To the value:

secret=lt--ENCRYPTED

I think both ways can work

We also need to document how encryption work. Users needs to have a LATITUDE_SECRET_KEY in their .env file (which should be in the .gitignore file of the data project). The idea is to do what Rails does. Use this LATITUDE_SECRET_KEY do decrypt it on latitude's server.

On their side they need to encrypt the value of the encrypted params in the same way and with the same LATITUDE_SECRET_KEY. TO_BE_DEFINED

I think nothing need to be done in terms of using the encrypted param in queries or views. In a view users do param('secret') or whatever name they use for this param. And this send to the API the param encrypted. Is the server which before passing to the query builder decrypt the params with LATITUDE_SECRET_KEY

It should fail if we find some param that needs to be decrypted and we don't have the secret key. Also it should not fail if decryption fail. If someone pass an incorrect encrypted key we pass through the param to the query and the query will fail

Support for static assets

WAT

We need to add support for adding static files to a Latitude app such as svgs, pngs, and whatnot. The static files need to be bundled with the production build.

Typescript does not work on `apps/server/routes/+layout.svelte

What?

If I try to use generated types from Svelte on our ./apps/server/routes/+layout.servert.ts file it does not work at runtime

Doing this
image

Result in this runtime error:
image

The error is pointing to an issue with our vite plugin

Temporary fix

Not ideal but the solution is to remove lang="ts" from the <script> tag in +layout.svelte and use JSDoc instead
image

`latitude run` improvements

  • Table cuts off the last 2 results and there's no way to navigate to them

  • Accept full file paths in the run command.

Right now the latitude run command accepts referring to queries just with the name of the file.

We want to support VSCode tasks to make the experience more streamlined, so the command needs to accept full file paths too through a flag or parameter.

Too many connections open Mysql

It seems that each time the RunButton is clicked, the connector initiates a new MySQL connection, leading to an error message stating: "ER_CON_COUNT_ERROR: Too many connections

Add a function to display parameters reactively in the View

We need a param function to display parameters in views, like this:

<Input param='name' />

<Text.H1>
  Hello, {param('name')}!
</Text.H1>

To create a function like this, which is 1. autoimported and 2. reactive without needing to add "$", wee can use the same method as we are doing with runQuery, where a vite script creates the import, moves the method call to a script tag and assignes the result to a variable, and finally replaces the original call with a suscription to that variable. After the transformation, it should look like this:

<script>
  import {Β param }Β from '...';
  const val = param('name');
</script>

<Input param='name' />

<Text.H1>
  Hello, {$val}!
</Text.H1>

Support for themes

We need a way to declare different themes in a project and then apply them to the views.

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.