<commit_before>import crossfilter from "crossfilter2";
import { max, mean, median, sum } from "d3-array";
import { scaleThreshold } from "d3-scale";
import { money } from "lib/vue/filters";
import {
  AmountDistributionBars,
  GroupPctDistributionBars
} from "lib/visualizations";
import Vue from "vue";
import VueRouter from "vue-router";
import { getRemoteData, calculateSumMeanMedian } from "../webapp/lib/utils";
import { EventBus } from "../webapp/mixins/event_bus";

const d3 = { scaleThreshold, sum, mean, median, max };
import { checkAndReportAccessibility } from "lib/vue/accesibility";

Vue.use(VueRouter);
Vue.use(checkAndReportAccessibility);
Vue.config.productionTip = false;

export class ContractsController {
  constructor(options) {
    this.charts = {};
    this.tendersFilters = {
      submission_date: [],
      process_type: [],
      contract_type: []
    };

    const selector = "gobierto-visualizations-contracts-app";

    // Mount Vue applications
    const entryPoint = document.getElementById(selector);

    if (entryPoint) {
      const htmlRouterBlock = `<router-view></router-view>`;

      entryPoint.innerHTML = htmlRouterBlock;

      const Home = () =>
        import("../webapp/containers/contracts/Home.vue");
      const Summary = () =>
        import("../webapp/containers/contracts/Summary.vue");
      const ContractsIndex = () =>
        import("../webapp/containers/contracts/ContractsIndex.vue");
      const ContractsShow = () =>
        import("../webapp/containers/contracts/ContractsShow.vue");
      const AssigneesShow = () =>
        import("../webapp/containers/contracts/AssigneesShow.vue");

      Promise.all([
        getRemoteData(options.contractsEndpoint),
        getRemoteData(options.tendersEndpoint)
      ]).then(rawData => {
        this.setGlobalVariables(rawData);

        const router = new VueRouter({
          mode: "history",
          routes: [
            {
              path: "/visualizaciones/contratos",
              component: Home,
              props: { dataDownloadEndpoint: options.dataDownloadEndpoint },
              children: [
                { path: "", name: "summary", component: Summary },
                {
                  path: "adjudicaciones",
                  name: "contracts_index",
                  component: ContractsIndex
                },
                {
                  path: "adjudicaciones/:id",
                  name: "contracts_show",
                  component: ContractsShow
                },
                {
                  path: "adjudicatario/:id",<commit_msg>add an alias to visualizations homepage<commit_after>import crossfilter from "crossfilter2";
import { max, mean, median, sum } from "d3-array";
import { scaleThreshold } from "d3-scale";
import { money } from "lib/vue/filters";
import {
  AmountDistributionBars,
  GroupPctDistributionBars
} from "lib/visualizations";
import Vue from "vue";
import VueRouter from "vue-router";
import { getRemoteData, calculateSumMeanMedian } from "../webapp/lib/utils";
import { EventBus } from "../webapp/mixins/event_bus";

const d3 = { scaleThreshold, sum, mean, median, max };
import { checkAndReportAccessibility } from "lib/vue/accesibility";

Vue.use(VueRouter);
Vue.use(checkAndReportAccessibility);
Vue.config.productionTip = false;

export class ContractsController {
  constructor(options) {
    this.charts = {};
    this.tendersFilters = {
      submission_date: [],
      process_type: [],
      contract_type: []
    };

    const selector = "gobierto-visualizations-contracts-app";

    // Mount Vue applications
    const entryPoint = document.getElementById(selector);

    if (entryPoint) {
      const htmlRouterBlock = `<router-view></router-view>`;

      entryPoint.innerHTML = htmlRouterBlock;

      const Home = () =>
        import("../webapp/containers/contracts/Home.vue");
      const Summary = () =>
        import("../webapp/containers/contracts/Summary.vue");
      const ContractsIndex = () =>
        import("../webapp/containers/contracts/ContractsIndex.vue");
      const ContractsShow = () =>
        import("../webapp/containers/contracts/ContractsShow.vue");
      const AssigneesShow = () =>
        import("../webapp/containers/contracts/AssigneesShow.vue");

      Promise.all([
        getRemoteData(options.contractsEndpoint),
        getRemoteData(options.tendersEndpoint)
      ]).then(rawData => {
        this.setGlobalVariables(rawData);

        const router = new VueRouter({
          mode: "history",
          routes: [
            {
              path: "/visualizaciones/contratos",
              alias: "/",
              component: Home,
              props: { dataDownloadEndpoint: options.dataDownloadEndpoint },
              children: [
                { path: "", name: "summary", component: Summary },
                {
                  path: "adjudicaciones",
                  name: "contracts_index",
                  component: ContractsIndex
                },
                {
                  path: "adjudicaciones/:id",
                  name: "contracts_show",
                  component: ContractsShow
                },
                {
                  path: "adjudicatario/:id",
{'fraction_non_alphanumeric': 0.12418924074780618, 'fraction_numerical': 0.0015261350629530714, 'mean_word_length': 2.328888888888889, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3957520', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1416, 'n_words': 275}