Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add charts endpoints #27

Merged
merged 17 commits into from
Aug 14, 2023
Merged

add charts endpoints #27

merged 17 commits into from
Aug 14, 2023

Conversation

andersy005
Copy link
Member

@andersy005 andersy005 commented Aug 8, 2023

WIP

@github-actions github-actions bot added the api label Aug 8, 2023
@andersy005 andersy005 temporarily deployed to staging August 9, 2023 00:13 — with GitHub Actions Inactive
@andersy005 andersy005 temporarily deployed to staging August 9, 2023 00:26 — with GitHub Actions Inactive
@andersy005 andersy005 temporarily deployed to staging August 9, 2023 21:29 — with GitHub Actions Inactive
@andersy005 andersy005 temporarily deployed to staging August 9, 2023 22:00 — with GitHub Actions Inactive
@andersy005 andersy005 temporarily deployed to staging August 9, 2023 23:29 — with GitHub Actions Inactive
@andersy005
Copy link
Member Author

@katamartin, this is ready for another round of review when you get a chance. https://offsets-db-staging.fly.dev/docs

❯ http 'https://offsets-db-staging.fly.dev/charts/project_registration'

[
    {
        "category": "industrial-gases",
        "end": 2020,
        "start": 2019,
        "value": 2
    },
    {
        "category": "forest",
        "end": null,
        "start": null,
        "value": 18
    },
    {
        "category": "industrial-gases",
        "end": 2022,
        "start": 2022,
        "value": 1
    },
    {
        "category": "forest",
        "end": 2022,
        "start": 2021,
        "value": 1
    },
    {
        "category": "industrial-gases",
        "end": null,
        "start": null,
        "value": 2
    },
    {
        "category": "renewable",
        "end": 2022,
        "start": 2022,
        "value": 3
    },
    {
        "category": "other",
        "end": null,
        "start": null,
        "value": 8
    },
    {
        "category": "renewable",
        "end": 2022,
        "start": 2021,
        "value": 2
    },
    {
        "category": "industrial-gases",
        "end": 2021,
        "start": 2020,
        "value": 2
    },
    {
        "category": "industrial-gases",
        "end": 2014,
        "start": 2014,
        "value": 1
    },
    {
        "category": "forest",
        "end": 2023,
        "start": 2022,
        "value": 1
    }
]
❯ http 'https://offsets-db-staging.fly.dev/charts/issuance_totals?num_bins=2'
[
    {
        "category": "industrial-gases",
        "end": 50205898.0,
        "start": 0.0,
        "value": 0.0
    },
    {
        "category": "forest",
        "end": null,
        "start": null,
        "value": 100411797.0
    },
    {
        "category": "forest",
        "end": 50205898.0,
        "start": 0.0,
        "value": 0.0
    },
    {
        "category": "other",
        "end": 50205898.0,
        "start": 0.0,
        "value": 0.0
    },
    {
        "category": "renewable",
        "end": 50205898.0,
        "start": 0.0,
        "value": 0.0
    }
]

@katamartin
Copy link
Member

@andersy005 one behavior that's surprising and I think will be hard to implement a UI against is that the bin size is not regular. In the project_registration example above, why is the diff(end - start) sometimes 1 and sometimes 0?

@andersy005 andersy005 temporarily deployed to staging August 10, 2023 23:45 — with GitHub Actions Inactive
@andersy005 andersy005 temporarily deployed to staging August 11, 2023 01:22 — with GitHub Actions Inactive
@andersy005 andersy005 temporarily deployed to staging August 11, 2023 15:55 — with GitHub Actions Inactive
@andersy005 andersy005 temporarily deployed to staging August 11, 2023 18:12 — with GitHub Actions Inactive
@andersy005
Copy link
Member Author

merging this so we can test against production deployment

@andersy005 andersy005 merged commit f41d850 into main Aug 14, 2023
4 checks passed
@andersy005 andersy005 deleted the add-charts-endpoints branch August 14, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants