# Motivation

D3 is a great library and works really well, so why go through all the effort to use Angular to draw the SVGs vs. just creating a wrapper?

When we first started this project internally some two years ago, we did exactly that (yes, the core features of this library have been used in a production app for over two years now). It was very difficult to create highly reusable charts and the code was not clear.

Additionally, if we created a wrapper we would violate a core principle of frameworks like Angular or React, where there should only be one framework touching the DOM. If you have multiple libraries touching the DOM, things can get out of sync and create unpredictable results.

By creating charts using Angular components, it lets you create very composable charts with high reuse of common elements like axis, bars, circles, etc. It makes it even easier to extend to add capabilities or [compose advanced charts using a combination of components](/ngx-charts/custom-charts.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://swimlane.gitbook.io/ngx-charts/motivation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
