import d3 from 'd3';
import fcRebind from 'd3fc-rebind';
import {getStockFluxData} from '../../../../../../node_modules/stockflux-core/src/services/StockFluxService';

export default function() {
    var historicFeed = getStockFluxData(),
        granularity,
        candles;

    var allowedPeriods = d3.map();
    allowedPeriods.set(60 * 60 * 24, 'daily');
    allowedPeriods.set(60 * 60 * 24 * 7, 'weekly');

    var stockFluxAdaptor = function stockFluxAdaptor(cb) {
        var startDate = new Date();
        historicFeed.start(startDate);
        historicFeed(cb);
    };

    stockFluxAdaptor.candles = function(x) {
        if (!arguments.length) {
            return candles;
        }
        candles = x;
        return stockFluxAdaptor;
    };

    stockFluxAdaptor.granularity = function(x) {
        if (!arguments.length) {
            return granularity;
        }
        if (!allowedPeriods.has(x)) {
            throw new Error('Granularity of ' + x + ' is not supported.');
        }
        granularity = x;
        return stockFluxAdaptor;
    };

    stockFluxAdaptor.apiKey = function() {
        throw new Error('Not implemented.');
    };

    stockFluxAdaptor.database = function() {
        throw new Error('Not implemented.');
    };

    stockFluxAdaptor.columnNameMap = function() {
        throw new Error('Not implemented.');
    };

    fcRebind.rebindAll(stockFluxAdaptor, historicFeed);

    return stockFluxAdaptor;
}

import d3 from 'd3';
import fcRebind from 'd3fc-rebind';
import {getStockFluxData} from 'stockflux-core/src/services/StockFluxService';

export default function() {
    var historicFeed = getStockFluxData(),
        granularity,
        candles;

    var allowedPeriods = d3.map();
    allowedPeriods.set(60 * 60 * 24, 'daily');
    allowedPeriods.set(60 * 60 * 24 * 7, 'weekly');

    var stockFluxAdaptor = function stockFluxAdaptor(cb) {
        var startDate = new Date();
        historicFeed.start(startDate);
        historicFeed(cb);
    };

    stockFluxAdaptor.candles = function(x) {
        if (!arguments.length) {
            return candles;
        }
        candles = x;
        return stockFluxAdaptor;
    };

    stockFluxAdaptor.granularity = function(x) {
        if (!arguments.length) {
            return granularity;
        }
        if (!allowedPeriods.has(x)) {
            throw new Error('Granularity of ' + x + ' is not supported.');
        }
        granularity = x;
        return stockFluxAdaptor;
    };

    stockFluxAdaptor.apiKey = function() {
        throw new Error('Not implemented.');
    };

    stockFluxAdaptor.database = function() {
        throw new Error('Not implemented.');
    };

    stockFluxAdaptor.columnNameMap = function() {
        throw new Error('Not implemented.');
    };

    fcRebind.rebindAll(stockFluxAdaptor, historicFeed);

    return stockFluxAdaptor;
}

Fix relative import to be absolute
Fix relative import to be absolute
