{"id":13730430,"url":"https://github.com/franshej/CustomMatPlot","last_synced_at":"2025-05-08T03:30:36.268Z","repository":{"id":190486663,"uuid":"486183072","full_name":"franshej/CustomMatPlot","owner":"franshej","description":"Plot library for the JUCE Framework","archived":false,"fork":false,"pushed_at":"2024-10-28T11:12:23.000Z","size":5639,"stargazers_count":67,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-28T14:35:33.910Z","etag":null,"topics":["component","juce","juce-framework","plot"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/franshej.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-27T12:29:14.000Z","updated_at":"2024-10-28T11:12:24.000Z","dependencies_parsed_at":"2023-10-12T04:07:57.719Z","dependency_job_id":"f3a861c4-23a4-43e1-be00-1be45645d564","html_url":"https://github.com/franshej/CustomMatPlot","commit_stats":null,"previous_names":["franshej/custommatplot"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franshej%2FCustomMatPlot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franshej%2FCustomMatPlot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franshej%2FCustomMatPlot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franshej%2FCustomMatPlot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franshej","download_url":"https://codeload.github.com/franshej/CustomMatPlot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224695493,"owners_count":17354422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","juce","juce-framework","plot"],"created_at":"2024-08-03T02:01:14.719Z","updated_at":"2024-11-14T21:30:58.520Z","avatar_url":"https://github.com/franshej.png","language":"C++","funding_links":[],"categories":["Graphics \u0026 Video"],"sub_categories":[],"readme":"# CustomMatPlot\n## Plot library for the JUCE Framework\n\nCustomMatPlot (CMP) is a plotting library for C++. It provides an API for embedding plot components into applications using the JUCE framework. The plot component is easy to integrate and is customizable using the included lookandfeel class.\n\n| ![Image](img/spread.png)  | ![Image](img/sines.png)|\n| ------------- | ------------- |\n\n\u003e Note: I'm not a senior developer so there may be several design flaws.\n\n## Table of Content\n  - [Features](#features)\n  - [Requirements](#requirements)\n  - [Controls](#controls)\n  - [LookAndFeel](#lookandfeel)\n  - [Graph line attributes](#graph-line-attributes)\n  - [Examples](#examples)\n  - [Realtime frequency response example](#realtime-frequency-response-example)\n  - [Tests](#tests)\n  - [License](#license)\n\n## Features\n\u003ca name=\"features\"\u003e\u003c/a\u003e\n\nCMP implements many of the same features that exist in Matplotlib.\nBelow is the feature list of CMP:\n\n- Axis scaling: Linear and logarithmic.\n- Customizable view using the lookandfeel class.\n- Legend.\n- Zoom.\n- Trace.\n- Fill area between two graphs.\n- Axis labels.\n- Ticks and Tick-labels.\n- Grids and tiny grids.\n- Markers: Star, triangles, square etc.\n- Custom stroke path.\n- Callback for every visible data point.\n- Callback for tace points.\n- Two different downsampler levels.\n- Move points in the garph with mouse.\n- Customizable userinput mapping using lookandfeel class.\n\n![Image](img/heart.png) \n\n## Requirements\n\u003ca name=\"requirements\"\u003e\u003c/a\u003e\n\n- Compiler that supports C++17\n- CMake 3.12\n\n## Controls\n\u003ca name=\"controls\"\u003e\u003c/a\u003e\n\nThe CMP compontent implements MouseEvents to interact with the plot using the mouse. Below is a list with the default added mouse commands which can be overrided using a custom lookandfeel class (see \"move_pixel_points\" example):\n\n1. Left click drag anywhere in the graph area to zoom into the plot. The zoom area is displayed as traced lined rectangle.\n2. Right click to zoom out to home.\n3. Double-click to add a trace-point to the graph lines closest to the mouse pointer.\n4. Double-click on a trace-point to remove it.\n5. Drag the trace point to move it along the graph-line.\n6. Move the trace point label by dragging it.\n7. Move the legend to by dragging it.\n8. Move pixel points.\n8. Panning.\n\n## LookAndFeel\n\u003ca name=\"lookandfeel\"\u003e\u003c/a\u003e\n\nCustomize the plot to your liking by overriding the lookandfeel functions. See the lookandfeel example.\n\n![Image](img/lookandfeel.png)\n\n## Graph line attributes\n\u003ca name=\"graph-line-attributes\"\u003e\u003c/a\u003e\n\nUse the graph line attributes to change the appearance of the graph lines. See custom_graph_attributes example.\n\n![Image](img/graph_line_attributes.png)\n\n## Examples\n\u003ca name=\"examples\"\u003e\u003c/a\u003e\nThe examples can be built using the following commands:\n\n```sh\n# Clone repository\ngit clone https://github.com/franshej/CustomMatPlot.git\n\ncd CustomMatPlot\n\n# Update submodules\ngit submodule update --init\n\nmkdir build\ncd build\n\n# Config \u0026 build\ncmake ../ -DCMP_BUILD_EXAMPLES=ON\nmake -j4\n```\n\n## Realtime frequency response example app\n\u003ca name=\"realtime-frequency-response-example\"\u003e\u003c/a\u003e\n\nAn example app plotting the frequency response of the incoming left and right audio signals can be seen here: \u003ca href=\"https://github.com/franshej/Realtime-Frequency-Plot-Example\"\u003e Realtime plot example \u003c/a\u003e\n\n![Image](img/freq-plot-ui.png)\n\n## Tests\n\n### Unit testing\nThe `juce::UnitTest` class is wrapped into macros to make it easier to write new structured tests.\n\n```cpp\nSECTION(PlotTest, \"Plot class\") {\n  cmp::Plot plot;\n\n  TEST(\"Part 1: empty graph line.\") {\n    const auto graph_lines = getChildComponentHelper\u003ccmp::GraphLine\u003e(plot);\n    expect(graph_lines.empty());\n  }\n\n  TEST(\"Part 2: single graph line\") {\n    plot.plot({y_data1});\n    ...\n  }\n}\n```\n\n\n### Manual tests\n\u003ca name=\"tests\"\u003e\u003c/a\u003e\nTo make it more convenient to write new manual tests the CMP library implements tests macros similar to the macros in google tests.\n\nThe following example below will plot a ramp of 10 values from 0-9:\n```cpp\nTEST(ramp, non_real_time) {\n  ADD_PLOT;\n\n  std::vector\u003cfloat\u003e y_test_data(10u);\n  std::iota(y_test_data.begin(), y_test_data.end(), 0.0f);\n\n  PLOT_Y({y_test_data});\n}\n```\n\n![Image](img/ramp.png)\n\n\n## License\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2022 Frans Rosencrantz\n\n**Free Software, Hell Yeah!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranshej%2FCustomMatPlot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranshej%2FCustomMatPlot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranshej%2FCustomMatPlot/lists"}