GithubHelp home page GithubHelp logo

chartcraft's Introduction

ChartCraft

ChartCraft is a Java and Scala-based Integrated Development Environment (IDE) designed for creating graphical representations such as charts with embedded text. Developed as part of the Software Correctness course at Aarhus University, this application provides a platform for users to input graphical commands and view their output dynamically on a Euclidean plane.

Features

Euclidean Graphics Viewer: Features a viewer that displays graphical objects with a background grid.

Graphics Language Editor: An editor that allows users to input and modify graphical commands which directly influence the viewer without intermediate processing.

Dynamic Drawing with Bounding Box: Implements a bounding box within which all drawings are clipped, enhancing the control over visible graphics.

Support for Multiple Shapes and Colors: Users can draw lines, rectangles, circles, and embed text, with support for multiple colors and fill options.

Real-time Highlighting: Highlights the currently drawn object, providing immediate visual feedback. ( in progress )

Prerequisites

To run ChartCraft, you must have the following installed:

  • Java JDK 11 or higher
  • Scala SDK 2.13 or higher
  • Simple Build Tool (SBT) for compiling Scala code

Installation

To get started with ChartCraft, clone the repository and compile the source code:

git clone https://github.com/arman-bd/chartcraft.git
cd chartcraft
sbt compile

Running the Application

To launch the ChartCraft IDE, execute the following command:

sbt run

The application window should open, divided into a graphical viewer on the left and a graphics command editor on the right.

Command Syntax Table

Command Description Syntax Example
BOUNDING-BOX Defines a bounding box within which to draw. (BOUNDING-BOX (x1 y1) (x2 y2)) (BOUNDING-BOX (0 0) (300 300))
LINE Draws a line between two points. (LINE (x1 y1) (x2 y2)) (LINE (100 100) (200 200))
RECTANGLE Draws a rectangle given two opposite corners. (RECTANGLE (x1 y1) (x2 y2)) (RECTANGLE (50 50) (150 150))
CIRCLE Draws a circle given a center point and radius. (CIRCLE (x y) r) (CIRCLE (120 120) 60)
TEXT-AT Places text at a specified position. (TEXT-AT (x y) "text") (TEXT-AT (160 160) "Hello, world!")
DRAW Applies a color to enclosed commands. (DRAW color g1 g2 ...), where g1, g2, ... are commands (DRAW red (LINE (10 10) (200 200)))
FILL Fills a drawable object with color. (FILL color g), where g is a drawable command (FILL blue (CIRCLE (100 100) 50))

Additional Notes

  • Coordinates and Measurements: All coordinates and dimensions are in pixels.
  • Colors: Supported color values include black, red, green, blue, yellow. Custom colors need to be defined in the color map within the Scala code.
  • Order of Operations: All drawing commands must respect the bounding box if defined. Commands are executed in the order they are provided.
  • Nested Commands: DRAW and FILL commands can contain other drawing commands.

This table provides a clear guide to the syntax required by ChartCraft for creating and manipulating graphical elements on the canvas. Users should refer to this table to ensure their commands are correctly formatted to achieve the desired graphical output.

Example:

(BOUNDING-BOX (1 1) (500 500))
(LINE (150 100) (150 200))
(LINE (150 100) (100 150))
(LINE (150 100) (200 150))
(LINE (230 120) (200 150))
(DRAW red (TEXT-AT (230 120) "@"))
(CIRCLE (150 75) 30)
(FILL red (CIRCLE (135 75) 10))
(FILL red (CIRCLE (165 75) 10))
(FILL black (CIRCLE (148 90) 3))
(FILL black (CIRCLE (152 90) 3))
(LINE (150 200) (200 250))
(LINE (150 200) (100 250))
(TEXT-AT (70 290) "ChartCraft is Awesome!!")
(DRAW red (TEXT-AT (110 320) "YAY!!"))
(DRAW green (TEXT-AT (160 320) "YAY!!"))

TODO

  • Need to work on coordinate and size as per project guideline
  • Need to apply testing strategies for both Java and Scala part of the project.

Contributing

Contributions are welcome. Please fork the repository, create a feature branch, and submit a pull request for review.

Testing

TBD

Documentation

TBD

Authors

Arman and Team

License

This project is licensed under the MIT License.

Acknowledgments

Aarhus University - For providing the academic environment and guidance necessary for this project.

chartcraft's People

Contributors

arman-bd avatar

Watchers

 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.