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

Broken and unclear documentation #191

Closed
zedtux opened this issue Nov 20, 2020 · 10 comments
Closed

Broken and unclear documentation #191

zedtux opened this issue Nov 20, 2020 · 10 comments
Labels

Comments

@zedtux
Copy link

zedtux commented Nov 20, 2020

Expected Behavior

I'm trying to get a line chart working but it's quite hard since the Line documentation examples are broken and quite unclear because, for instance, the first example code look like this:

const lineData = require('./lineChart.fixtures').default;
    const ResponsiveContainer = require('../helpers/responsiveContainer.js').default;
    const margin = {
        top: 60,
        right: 30,
        bottom: 60,
        left: 70,
    };

    const renderLine = (props) => (
        <ResponsiveContainer
            render={
                ({width}) =>
                    <Line
                        margin={margin}
                        lineCurve="basis"
                        width={width}
                        {...props}
                    />
            }
        />
    );

    <Tooltip
        data={lineData.oneSet()}
        render={renderLine}
        topicLabel="topics"
        title="Tooltip Title"
    />

The import of the <Line> component seem to be missing?

Current Behavior

After searching a lot, I got a working chart, and I wanted to changed the axisTimeCombinations prop. I see there should be some constants to be used (here too, the documentation has a formatting issue on the constant names):

MINUTE_HOUR, HOUR_DAY, DAY_MONTH, MONTH_YEAR

But I can't find them in this package so I tried to use 0 and then 1, hoping to find a good one by any luck but then it fails with the following error:

Uncaught TypeError: t[e] is not a function
    React 11
    unstable_runWithPriority scheduler.development.js:661
    React 5
    unstable_runWithPriority scheduler.development.js:661
    React 4
    Redux 7
    fetchOneResponseTimes actions.js:21
britecharts-react.min.js:49
    o React
    o self-hosted:954
    forEach self-hosted:225
    React 10
    commitRootImpl self-hosted:954
    unstable_runWithPriority scheduler.development.js:661
    React 4
    performSyncWorkOnRoot self-hosted:897
    flushSyncCallbackQueueImpl React
    unstable_runWithPriority scheduler.development.js:661
    React 4
    Redux 3
    handleChangeWrapper self-hosted:850

The package JavaScript seems to be minified, so it's unreadable 🤷‍♂️.

Here is my code so far:

<ResponsiveContainer
              render={
                ({ width }) => (
                  <Line
                    axisTimeCombinations={2}
                    data={{ data: oneResponseTimes }}
                    lineCurve="basis"
                    margin={{
                      top: 60,
                      right: 30,
                      bottom: 60,
                      left: 70
                    }}
                    height={200}
                    width={width}
                  />
                )
              }
            />

BTW I can't get the <ResponsiveContainer> component to update the width.

Your Environment

  • Britecharts-React version used: latest (0.5.4)
  • Browser Name and version: Firefox 78.5.0esr (64-bit)
  • Operating System and version: Linux Debian Buster
@zedtux zedtux added the bug label Nov 20, 2020
@Golodhros
Copy link
Collaborator

Thanks for the issue @zedtux!
Sorry for that, I will try to jump into this during the weekend!

@Golodhros
Copy link
Collaborator

This fixes the demo: #192

@Golodhros
Copy link
Collaborator

You are right about the axisTimeCombinations, that should be provided along with the chart component. I will fix that soon.

For now, you can reference this file: https://github.com/Golodhros/britecharts/blob/6cc31390f7acbe21faafbf30baeeb5921c4c3810/src/charts/helpers/constants.js#L8

@Golodhros
Copy link
Collaborator

This should fix it: #193

@zedtux
Copy link
Author

zedtux commented Nov 24, 2020

Just to let you know: I've switched to another library, but it's cool you're fixing all that things. Will see in a next project if this lib is strong enough 😉

@Golodhros
Copy link
Collaborator

Just to let you know: I've switched to another library, but it's cool you're fixing all that things. Will see in a next project if this lib is strong enough 😉

Totally understand!
We have left aside Britecharts React for too long while we prepare Britecharts V3. Hopefully you will get all the new goodness when you are back to check!

@marcelovani
Copy link
Contributor

marcelovani commented Jan 12, 2021

package.json needs to be updated to use the latest tag https://github.com/britecharts/britecharts-react/releases/tag/0.6.3

@Golodhros
Copy link
Collaborator

package.json needs to be updated to use the latest tag https://github.com/britecharts/britecharts-react/releases/tag/0.6.3

Not sure if I understand, it seems the package.json version is 0.6.3

@marcelovani
Copy link
Contributor

Sorry, I was meant to paste this url https://github.com/britecharts/britecharts-react-test-project/blob/master/package.json
The test project is still broken on master

@Golodhros
Copy link
Collaborator

Sorry, I was meant to paste this url https://github.com/britecharts/britecharts-react-test-project/blob/master/package.json
The test project is still broken on master

Ah, thanks for the heads up!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants